diff options
Diffstat (limited to 'src/ui/main_window/GeneralMainWindow.cpp')
-rw-r--r-- | src/ui/main_window/GeneralMainWindow.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/ui/main_window/GeneralMainWindow.cpp b/src/ui/main_window/GeneralMainWindow.cpp index f58326f9..3d662332 100644 --- a/src/ui/main_window/GeneralMainWindow.cpp +++ b/src/ui/main_window/GeneralMainWindow.cpp @@ -28,9 +28,9 @@ #include "GeneralMainWindow.h" -#include "ui/struct/SettingsObject.h" -#include "ui/struct/settings/AppearanceSO.h" -#include "ui/struct/settings/WindowStateSO.h" +#include "core/model/SettingsObject.h" +#include "ui/struct/settings_object/AppearanceSO.h" +#include "ui/struct/settings_object/WindowStateSO.h" namespace GpgFrontend::UI { @@ -65,6 +65,8 @@ void GpgFrontend::UI::GeneralMainWindow::slot_restore_settings() noexcept { QByteArray::fromBase64(window_state.window_state_data.toUtf8())); } + this->setMinimumSize(640, 480); + // restore window size & location if (window_state.window_save) { pos_ = {window_state.x, window_state.y}; @@ -96,16 +98,16 @@ void GpgFrontend::UI::GeneralMainWindow::slot_restore_settings() noexcept { parent_size.height()); if (parent_pos != QPoint{0, 0}) { - QPoint parent_center{parent_pos.x() + parent_size.width() / 2, - parent_pos.y() + parent_size.height() / 2}; + QPoint const parent_center{parent_pos.x() + parent_size.width() / 2, + parent_pos.y() + parent_size.height() / 2}; pos_ = {parent_center.x() - size_.width() / 2, parent_center.y() - size_.height() / 2}; } } - if (size_.width() < 600) size_.setWidth(600); - if (size_.height() < 400) size_.setHeight(400); + if (size_.width() < 640) size_.setWidth(640); + if (size_.height() < 480) size_.setHeight(480); this->move(pos_); this->resize(size_); @@ -114,7 +116,7 @@ void GpgFrontend::UI::GeneralMainWindow::slot_restore_settings() noexcept { } // appearance - AppearanceSO appearance(SettingsObject("general_settings_state")); + AppearanceSO const appearance(SettingsObject("general_settings_state")); icon_size_ = {appearance.tool_bar_icon_width, appearance.tool_bar_icon_height}; @@ -125,7 +127,7 @@ void GpgFrontend::UI::GeneralMainWindow::slot_restore_settings() noexcept { icon_style_ = toolButtonStyle(); } catch (...) { - GF_UI_LOG_ERROR("gernal main window: {}, caught exception", name_); + GF_UI_LOG_ERROR("general main window: {}, caught exception", name_); } } @@ -148,7 +150,7 @@ void GpgFrontend::UI::GeneralMainWindow::slot_save_settings() noexcept { general_windows_state.Store(window_state.Json()); } catch (...) { - GF_UI_LOG_ERROR("gernal main window: {}, caught exception", name_); + GF_UI_LOG_ERROR("general main window: {}, caught exception", name_); } } |