diff options
author | Saturneric <[email protected]> | 2022-07-23 11:33:42 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-07-23 11:33:42 +0000 |
commit | da9494c35e1d405fcd2c645159236a3e05deb934 (patch) | |
tree | 5abb7be4f3471fd770c7e5cd25f33efc45441f42 /src/ui/main_window/GeneralMainWindow.cpp | |
parent | fix(ci): delete ubuntu 18.04 from deb package build (diff) | |
download | GpgFrontend-da9494c35e1d405fcd2c645159236a3e05deb934.tar.gz GpgFrontend-da9494c35e1d405fcd2c645159236a3e05deb934.zip |
fix(ui): fix button style problem
Diffstat (limited to '')
-rw-r--r-- | src/ui/main_window/GeneralMainWindow.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/ui/main_window/GeneralMainWindow.cpp b/src/ui/main_window/GeneralMainWindow.cpp index 42e53ac3..7df73aba 100644 --- a/src/ui/main_window/GeneralMainWindow.cpp +++ b/src/ui/main_window/GeneralMainWindow.cpp @@ -77,20 +77,24 @@ void GpgFrontend::UI::GeneralMainWindow::slot_restore_settings() noexcept { size_ = {width, height}; } - int width = general_windows_state.Check("icon_size").Check("width", 24), - height = general_windows_state.Check("icon_size").Check("height", 24); + + // appearance + SettingsObject general_settings_state("general_settings_state"); + + int width = general_settings_state.Check("icon_size").Check("width", 24), + height = general_settings_state.Check("icon_size").Check("height", 24); LOG(INFO) << "icon_size" << width << height; icon_size_ = {width, height}; - font_size_ = general_windows_state.Check("font_size", 10); + font_size_ = general_settings_state.Check("font_size", 10); this->setIconSize(icon_size_); // icon_style int s_icon_style = - general_windows_state.Check("icon_style", Qt::ToolButtonTextUnderIcon); - auto icon_style = static_cast<Qt::ToolButtonStyle>(s_icon_style); - this->setToolButtonStyle(icon_style); + general_settings_state.Check("icon_style", Qt::ToolButtonTextUnderIcon); + this->setToolButtonStyle(static_cast<Qt::ToolButtonStyle>(s_icon_style)); + icon_style_ = toolButtonStyle(); } catch (...) { LOG(ERROR) << name_ << "error"; @@ -113,12 +117,17 @@ void GpgFrontend::UI::GeneralMainWindow::slot_save_settings() noexcept { general_windows_state["window_size"]["height"] = size_.height(); general_windows_state["window_save"] = true; + SettingsObject general_settings_state("general_settings_state"); + // icon size - general_windows_state["icon_size"]["width"] = icon_size_.width(); - general_windows_state["icon_size"]["height"] = icon_size_.height(); + general_settings_state["icon_size"]["width"] = icon_size_.width(); + general_settings_state["icon_size"]["height"] = icon_size_.height(); // font size - general_windows_state["font_size"] = font_size_; + general_settings_state["font_size"] = font_size_; + + // tool button style + general_settings_state["icon_style"] = this->toolButtonStyle(); } catch (...) { LOG(ERROR) << name_ << "error"; |