imagej / imagej-ui-swing

ImageJ UI for Java Swing.
BSD 2-Clause "Simplified" License
10 stars 20 forks source link

SwingColorTableWidget: Adopt scalable height #90

Closed tferr closed 1 year ago

tferr commented 2 years ago

Currently, the height of SwingColorTableWidget is hardwired at 20 pixels, which in hiDPI screens is too small. This makes it so that the widget is scaled to the height of a JTexField. Here is a before/after comparison (1.5x scaling factor):

image

The width is still hardwired to 256.

ctrueden commented 2 years ago

Thanks @tferr. I love this change, except for the fact that SwingTools resides in the updater subpackage, and is now being used outside that subpackage.

To keep things organized, what do you think we should do? Move SwingTools out of that subpackage? Or start a second more general Swing utility methods class? Or something else?

tferr commented 2 years ago

I did not notice that. Oops. This is such a tiny method, that could be moved anywhere. Maybe just inside the SwingColorTableWidget class? I also changed SwingColorBar, but to be honest, I could not find any calls to it, so we could leave that as-is?

ctrueden commented 2 years ago

Moving the colorBarHeight method into the SwingColorBarWidget for now sounds good to me!

tferr commented 2 years ago

Should be OK now. Let me know if something is still missing.