-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MT 1.5.0 Macro dialog size persistance #353
Comments
+1 No technical reason this wasn't done, just default behavior and #time. |
@JamzTheMan - Looking at this and I see that the MacroButtonDialog class uses the WindowPreferences class to handle saving/restoring of window position preferences. The WindowPreferences class knows nothing about the why of the window closing and simply triggers off the window closing event. As far as I can tell there is no way for the WindowPreferences class to know that an "OK" button was pressed without assuming knowledge of the MacroButtonDialog class. If the MacroButtonDialog class kept a reference to the WindowPreferences class and the storePreferences() method was public or there was a public method to set a flag for "saveOnClose" then it could be handled but that clearly breaks the whole intent of the design of WindowPreferences. WindowPreferences only saves the prefs on the window closing event (Red X) and not the window closed events generated by the OK and Cancel buttons. So adding the windowClosing() method to WindowPreferences with a storePreferences() call would save when the OK button was pressed but also when Cancel was pressed. Hopefully I'm missing something simple here. |
I am looking into this. The implementation of the fix seems straightforward: as @Phergus mentioned, it looks like we need to a WindowClosed handler which duplicates the work done by the WindowClosing handler. I have tested this and it seems to work. |
- adds the windowClosed event - adds a couple of unit tests Fixes RPTools#353
Tested. Window size is saved on any close action. |
The macro dialog only persists it current size when clicking the X on the title bar.
This does not make any sense, in my opinion.
The standard behavior, as far as I know, is that a window or dialog should only persist current size on OK.
The text was updated successfully, but these errors were encountered: