summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/SettingsWindow.h
AgeCommit message (Collapse)Author
2022-05-12LibGUI: Support "modified" window state in SettingsWindowSam Atkins
SettingsWindow now notices if the window is marked as modified, and shows a confirmation pop-up to check if the user wants to apply or discard their changes. It automatically marks the window as unmodified after restoring defaults or applying the changes, but each Tab subclass needs to call `set_modified(true)` when the user modifies things. The "Apply" button is automatically disabled when there are no unsaved changes to be applied.
2022-04-21LibGUI+Applications: Add --open-tab option to FooSettings applicationsSam Atkins
Similar to SystemMonitor's option of the same name, this allows you to launch the given application with the specific tab open.
2022-04-21LibGUI+Applications: Give SettingsWindow tabs a string IDSam Atkins
This gives us a convenient way to refer to them, which will be used in the following commit.
2022-03-12Libraries: Use default constructors/destructors in LibGUILenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2021-11-28LibGUI: Move GUI::SettingsWindow setup out of the constructorAndreas Kling
In order to propagate errors that occur during UI setup, we have to move all that logic out of widget/window subclass constructors. This is a first attempt at doing that, for GUI::SettingsWindow.
2021-11-28LibGUI: Make GUI::SettingsWindow::add_tab() return ErrorOrAndreas Kling
This allows us to use TRY() when creating settings UI.
2021-11-27LibGUI: Add a cancel button callback to settings window tabskleines Filmröllchen
Some settings tabs, like the ones on the upcoming terminal settings, need to know when the cancel button is pressed to clean up things like temporary live updates. Therefore, the SettingsWindow::Tab now features a cancel_settings callback which does not need to be implemented.
2021-11-20LibGUI: Add SettingsWindow classSam Atkins
The FooSettings apps have quite a lot of boilerplate just around creating a tabbed window with the same styling and the same row of buttons along the bottom. So, let's extract that out into a class we can reuse! :^) You create a SettingsWindow instead of a regular Window, passing a title and a flag to determine if a "Defaults" button is shown. Then call add_tab() to add tabs to it. Tabs are widgets extending SettingsWindow::Tab, which has methods for saving and resetting the values.