microscope-cockpit / cockpit

Cockpit is a microscope graphical user interface. It is a flexible and easy to extend platform aimed at life scientists using bespoke microscopes.
https://microscope-cockpit.org
GNU General Public License v3.0
35 stars 26 forks source link

touchscreen icons don't fit to their buttons #717

Open carandraug opened 3 years ago

carandraug commented 3 years ago

The icons in the touchscreen buttons fit nicely inside the buttons on Windows only. In GTK3 and macOS they do not which looks odd. This how some of them look in GTK3:

touchscreen-icons

iandobbie commented 3 years ago

I tried changing the button size to 56x56 rather than 48x48 and it all looked much better on a mac, commit https://github.com/iandobbie/cockpit/commit/e323c7784312bf97de514393fede5f2779c57487

carandraug commented 3 years ago

Is there no way to avoid hardcoded button sizes?

Edit: thing is that hardcoded values will eventualy come back to bite us. Setting the button size from 48x48 to 56x56 fixes it for Mac but does not fix in GTK3. We can increase it further but eventually one of the backends changes the default theme that has larger borders and it breaks again.

iandobbie commented 3 years ago

I think with no size the button should be created exactly the right size to fit its contents.

iandobbie commented 3 years ago

Yes it does, but not as you might expect. Button are then too wide. image

iandobbie commented 3 years ago

Can be improved on with a call to self.SetWindowStyleFlag(wx.BU_EXACTFIT) image

iandobbie commented 3 years ago

Still seems to have more room on the right than the left for some reason.