Closed K-Meech closed 2 years ago
Great suggestion, @K-Meech!
In my opinion, the general issue is that ImageJ (1.x) modifies the look and feel at all, instead of respecting the current one. But there are also plugins out there that change the LaF globally. But modifying IJ1Helper to avoid as much as possible any changes to the global state is certainly desirable.
Do you think that remembering the current LaF and resetting it after this line: https://github.com/imagej/imagej-legacy/blob/0944272eb82ecc39ac9ceb8b7b63f6d6ce711155/src/main/java/net/imagej/legacy/IJ1Helper.java#L1353 ... would do it?
Or otherwise (and maybe better?), suggest a change to DirectoryChooser
in the original ImageJ to be less intrusive (i.e. reset to UIManager.getLookAndFeel
after having set to system look and feel just for the directory chooser)?
I think that would solve it yes - thanks @imagejan! Although, I imagine this would also have to be done for parts that use the ImageJ1 SaveDialog / OpenDialog as well - I think they do the same setting to system LAF.
Modifying it directly in the original ImageJ is probably the cleanest solution though! Where would I suggest this change? I'm happy to put a PR together, but I wasn't sure which repository to do it against?
Let's ping @rasband here:
Wayne, do you think the DirectoryChooser
can be modified in a way to reset the original look-and-feel after temporarily using the system look-and-feel for the folder choice dialog on Windows?
The latest ImageJ daily build (1.53o15) restores the original look and feel after temporarily using the system look and feel with Windows dialogs
The commit is at https://github.com/imagej/imagej1/commit/834d41b87163c879dc623ab2ee4d7121d6b2ea07
Great - thanks @rasband!
When using the
@Parameter
notation for aFile
in a fiji plugin - the look and feel is changed on Windows (e.g. see this issue: https://github.com/mobie/mobie-viewer-fiji/issues/525). This is due to the LegacyUIchooseFile
calling IJ1Helper functions here.E.g. for ij1Helper().getDirectory() this calls the imagej1 DirectoryChooser here. This changes the look and feel here to the system one - which is not the same as the one fiji opens with for Windows.
Would it be possible to record and reset the swing look and feel for all the IJ1Helper functions called in
chooseFile
? i.e. ij1Helper().getDirectory(), ij1Helper().saveDialog() and ij1Helper().openDialog()? Thanks!