Allow setting minimumSize of tiles
Just some quick notes:
- First time contributing to a KDE project
- First time touching any Qt code
- First time in nearly a decade since I touched any C++ codebase
So basically keep all of that in mind when reviewing, and let me know if I'm not following the proper procedure and need to jump through some more hoops.
Currently, the minimum tilesize allowed is 15% of the screen's width and height. This seems like a reasonable default for most monitors, but there's many situations when it's definitely not reasonable:
- Super ultrawides with a 32:9 aspect ratio
- Small screens that can only handle 1-3 tiles
- Vertical monitor orientations
I don't really know how you can calculate a good default to be honest. Maybe you can base it off of aspect ratios, DPI, size, and device type? But that seems a bit complicated, and I'm sure people will have different opinions on it.
So this MR basically changes the minimum size from a hardcoded constant into a mutable variable and exposes it to the KWin scripting API. The 15% still remains the default, but now you can simply say something like tile.minimumSize = { width: 0.05, height: 0.2 };
in your scripts to adjust it. Maybe it can be exposed as a configuration option at some point, but I definitely want to have it available for a script I'm working on.
I mostly just copied how padding
works in terms of how it gets set, so it recursively changes its children's minimumSize
and also exposes a minimumSizeChanged
signal in the same way.