Add an "auto" buttonsize option to explicitly use a calculated size for the buttons, based on the size of the window/display. My currently recommendation is the size could be calculated as:
min(48 * screen->w / 800, 48 * screen->h / 600)
This would cause the default screen size (on desktop Tux Paint) of 800x600 to continue using the 48x48 we've had all along (since the first release in 2002). It would have the side effect of using a smaller 38x38 button size in the lowest supported window size, 640x480, but IMO it actually looks better. On larger screens, the buttons would be larger; e.g. on 1920x1080 it would be 86x86. On 1920x1280, it would be 102x102.
Note that since current users of Tux Paint would probably not wish to have their canvas size changed unexpectedly after an upgrade -- and hence previously-saved images getting scaled when they load them back up -- I'm recommending this NOT be the default for desktop Tux Paint. It's probably a good idea for mobile, due to the much smaller physical screen size.
Made something to test, since a 102 button looks too big on my screen(laptop low dpi) and most likely too on a big tablet, but probably looks correct on high dpi devices I've also added a couple of smaller auto values.
With the attached patch you could call --buttonsize=size|auto|small|tiny
Please test
Pere
Tested the "auto" size in my phone (1920x1017, 5.5inch) and it displays perfectly, if I launch the same size in my 17inch laptop, the buttons looks too large to my taste, but the ratio screen/buttons is the same.
Then I've tried to account the DPI, unfortunately, SDL_GetDisplayDPI() returned 0 as dpi in all my tests.
I am going to commit the patch without the "small· and "tiny" stuff, as anyway, if parents have to tweak the button size, they could fine tune better by specifying the size.
Pere
TODO: Need to update documentation, --help output, and manpage, and add support for this in Tux Paint Config.
Update: docs, --help, bash completion, and manpage updated. Tux Paint Config still needs tackling (thinking a checkbox which would disable the slider).
Last edit: William Kendrick 2022-09-28
TPC now has a checkbox.