1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:47:45 +00:00

Browser+BrowserSettings: Persist the "show bookmarks bar" setting

Previously this setting was only temporary, but we now save/load it from
the config file.
This commit is contained in:
Sam Atkins 2021-11-24 20:04:43 +00:00 committed by Andreas Kling
parent 8a284be5c7
commit 1933076143
4 changed files with 40 additions and 1 deletions

View file

@ -110,9 +110,12 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url)
m_window_actions.on_show_bookmarks_bar = [](auto& action) {
Browser::BookmarksBarWidget::the().set_visible(action.is_checked());
Config::write_bool("Browser", "Preferences", "ShowBookmarksBar", action.is_checked());
};
m_window_actions.show_bookmarks_bar_action().set_checked(true);
bool show_bookmarks_bar = Config::read_bool("Browser", "Preferences", "ShowBookmarksBar", true);
m_window_actions.show_bookmarks_bar_action().set_checked(show_bookmarks_bar);
Browser::BookmarksBarWidget::the().set_visible(show_bookmarks_bar);
build_menus();