diff options
author | Mustafa Quraish <mustafaq9@gmail.com> | 2021-09-11 23:56:57 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-12 17:15:30 +0200 |
commit | 70d13ea66b9581989c1c1c971c7aa3b5c0777af5 (patch) | |
tree | a8603e0febfe1d2a415b6c770a5c12c68369352c | |
parent | 677aa7b769bc23fa0d5a141407c94ede74220a2a (diff) | |
download | serenity-70d13ea66b9581989c1c1c971c7aa3b5c0777af5.zip |
PixelPaint: Write changed settings back to config file
In a previous commit we read default values from a commit file, this
commit now also writes back any changes to those settings made by
the user. Persistent settings always feel good :^)
-rw-r--r-- | Userland/Applications/PixelPaint/MainWidget.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Applications/PixelPaint/MainWidget.cpp b/Userland/Applications/PixelPaint/MainWidget.cpp index e22748dc7d..03caf3d195 100644 --- a/Userland/Applications/PixelPaint/MainWidget.cpp +++ b/Userland/Applications/PixelPaint/MainWidget.cpp @@ -336,6 +336,7 @@ void MainWidget::initialize_menubar(GUI::Window& window) // Save this so other methods can use it m_show_guides_action = GUI::Action::create_checkable( "Show Guides", [&](auto& action) { + Config::write_bool("PixelPaint", "Guides", "Show", action.is_checked()); if (auto* editor = current_image_editor()) { editor->set_guide_visibility(action.is_checked()); } @@ -363,6 +364,7 @@ void MainWidget::initialize_menubar(GUI::Window& window) auto show_pixel_grid_action = GUI::Action::create_checkable( "Show Pixel Grid", [&](auto& action) { + Config::write_bool("PixelPaint", "PixelGrid", "Show", action.is_checked()); if (auto* editor = current_image_editor()) editor->set_pixel_grid_visibility(action.is_checked()); }); @@ -371,6 +373,7 @@ void MainWidget::initialize_menubar(GUI::Window& window) m_show_rulers_action = GUI::Action::create_checkable( "Show Rulers", { Mod_Ctrl, Key_R }, [&](auto& action) { + Config::write_bool("PixelPaint", "Rulers", "Show", action.is_checked()); if (auto* editor = current_image_editor()) { editor->set_ruler_visibility(action.is_checked()); } |