aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/GeneralMainWindow.cpp
diff options
context:
space:
mode:
authorSaturn&Eric <[email protected]>2024-05-11 17:18:36 +0000
committerGitHub <[email protected]>2024-05-11 17:18:36 +0000
commitf909f2c4c35b187eb165ec5545e35d54c6d92bf3 (patch)
tree428fe9e63ecae6bb93be6f20cd2b1ee9b29ffd8d /src/ui/main_window/GeneralMainWindow.cpp
parentMerge pull request #145 from jermanuts/jermanuts-wizard-links-update (diff)
parentfix: remove qt5compat and redirect dll output path of modules (diff)
downloadGpgFrontend-f909f2c4c35b187eb165ec5545e35d54c6d92bf3.tar.gz
GpgFrontend-f909f2c4c35b187eb165ec5545e35d54c6d92bf3.zip
Merge pull request #148 from saturneric/develop
Develop 2.1.3.1
Diffstat (limited to '')
-rw-r--r--src/ui/main_window/GeneralMainWindow.cpp22
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_);
}
}