JUCE icon indicating copy to clipboard operation
JUCE copied to clipboard

Add visibility status in ResizableWindow state get/restore methods

Open sigmate opened this issue 6 years ago • 2 comments

A small PR to easily also save/restore a window's visibility (e.g. supposably when using ApplicationProperties during a GUI application initialisation or shutdown).

The forceVisible param is handy to ensure a "main" window would always be visible, thus avoiding the potential confusion for the user to not see any opened window upon starting the application).

Example:

mainWindow->restoreWindowStateFromString (applicationProperties.getUserSettings()->getValue ("mainWindowState"), true);
        
auxWindow->restoreWindowStateFromString  (applicationProperties.getUserSettings()->getValue ("auxWindowState"));

Note: in order not to break anything with previously saved window states, the restoreWindowStateFromString method will look for a "h" (for hidden) token in the string.

sigmate avatar Jun 21 '19 10:06 sigmate

Sorry, just spotted a little issue. Will fix it by the end of the day.

sigmate avatar Jun 21 '19 13:06 sigmate

Ok, done.

sigmate avatar Jun 21 '19 15:06 sigmate