gnome-shell-extension-awesome-tiles icon indicating copy to clipboard operation
gnome-shell-extension-awesome-tiles copied to clipboard

[Suggestion] set gap size in pixels instead of percentage for fine tuning

Open Earthling-Z3R0 opened this issue 2 years ago • 5 comments

Great extension -- thanks for that! I am a pixel perfect guy and would love to set the gap size in pixels instead of percentages. Also, an option for respecting inner gaps would be awesome. Thank you very much for consideration :)

Earthling-Z3R0 avatar May 19 '22 15:05 Earthling-Z3R0

Hi, I went with percentage because it was the best way to support multiple monitors with different dimensions. I think it should be possible to calculate the percentage for a given pixel size. If that makes sense, I can implement the ability to set floating point numbers for the gaps so that you can fine tune them.

velitasali avatar Jun 18 '22 15:06 velitasali

I guess the point of @Earthling-Z3R0 is to have the same gap distance both vertically and horizontally. I was also interested in such change so I have changed my local files of your extension. In the extension.js file I have made the following modifications:

    // const gaps = {
    //   x: Math.min(gapUncheckedX, gapUncheckedY * 2),
    //   y: Math.min(gapUncheckedY, gapUncheckedX * 2),
    // }

    const gaps = {
      x: 15,
      y: 15,
    }

The result was quite satisfying on horizontal and vertical screens:

Screenshot from 2022-10-04 14-15-13 Screenshot from 2022-10-04 14-15-20

@velitasali if you don't mind, I am happy to create a PR against your repository with more advanced solution for fixed gap value, so the user would be able to choose between percent and pixel units.

sebdybowski avatar Oct 04 '22 11:10 sebdybowski

@sebdybowski -- Great change, thanks for this. I will change my file accordingly and am looking forward to an improved version of the extention.

Earthling-Z3R0 avatar Oct 04 '22 17:10 Earthling-Z3R0

In the end I did it differently. I changed the extension.js like this:

before:

     const gaps = {
       x: Math.min(gapUncheckedX, gapUncheckedY * 2),
       y: Math.min(gapUncheckedY, gapUncheckedX * 2),
     }

after:

     const gaps = {
       x: Math.min(gapUncheckedX, gapUncheckedY * 1.125),
       y: Math.min(gapUncheckedY, gapUncheckedX * 2),
     }

I am running 2560x1440 screen resolution so I changed the X gap quotient accordingly. (1440 is 56,25% of 2560) (1.125 is 56.25% of 2)

The result is same size gaps around all windows instead of different gap sizes while still being able to use the ingame gap setting to change gap size. (Should work for any 16:9 screen resolution.)

Earthling-Z3R0 avatar Oct 18 '22 13:10 Earthling-Z3R0

Sorry for the late reply. I will implement this in another release. Patches are welcome!

velitasali avatar Nov 12 '22 23:11 velitasali