Open alantcote opened 2 years ago
Hi @alantcote, I am analyzing the issue and learned, that Scene Builder indeed always starts maximized by default. An exception is MacOS, there Scene Builder does not start maximized.
The windows is positioned in com.oracle.javafx.scenebuilder.app.DocumentWindowController
within the openWindow()
method. Here a conditional call to getStage().setMaximized(true)
is placed when the platform is not MacOS. There is a corresponding closeWindow()
method.
Both places seem to be suitable to implement a point so memorize and load the actual window position. This could be handled by com.oracle.javafx.scenebuilder.app.preferences.PreferencesController
which offers the method PreferencesRecordDocument getRecordDocument(final DocumentWindowController dwc)
. The PreferencesRecordDocument
stores all view related settings such as stage height, visibility of elements and so on. So
PreferencesRecordDocument
DocumentWindowController.openWindow()
so that stage size is set according to values in PreferencesRecordDocument
(this must include a check that the window size and position suits the available screen space and an adjustment if screen space is not sufficient)DocumentWindowController.openWindow()
so that last stage size and position is saved to PreferencesRecordDocument
PreferencesWindowController
asking the use if Scene Builder shall start maximized (by default) using a checkbox@johanvos, @abhinayagarwal, @AlmasB:
Your proposal sounds good to me.
My personal preference would be to have an option to toggle this feature from the preferences dialog.
An option preferences dialog seems like a good idea. It provides a choice to the user.
Potentially useful if you implement the proposal would be my Preferences editor. It's a bit rough; if you know of a better tool for the purpose, please elucidate.
Would it be simpler (from both code and UX) to just remember the maximised state along with the window geometry instead of having to go and hunt down a preference option?
Sample code for window geometry memory may be found at https://github.com/alantcote/dupfilefinder2/blob/main/dupfilefinder2/src/main/java/cotelab/dupfilefinder2/WindowPrefs.java
The program nearly always starts up maximized.
Expected Behavior
It should "remember" the window geometry for the next use, or choose one which isn't so greedy for screen real-estate.
Current Behavior
The program nearly always starts up maximized.
Steps to Reproduce
The only thing I've had to do to reproduce the problem is to start up the program.
Your Environment
I nearly always start SceneBuilder from within the Eclipse IDE, on MS Windows 11.
Screenshots