From 4de03dd02ec96807ad5a0f80e7a0b89b0081d233 Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Wed, 26 Mar 2025 22:45:12 +0800 Subject: [PATCH] feat: support enforce windowed mode on start-up This feature is sponsored by @EdgarHartel. Issue: https://github.com/BLumia/pineapple-pictures/issues/143 --- app/mainwindow.cpp | 3 +++ app/settings.h | 1 + app/settingsdialog.cpp | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp index a025b6f..f89b82d 100644 --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -193,6 +193,9 @@ void MainWindow::initWindowSize() case Settings::WindowSizeBehavior::Maximized: showMaximized(); break; + case Settings::WindowSizeBehavior::Windowed: + showNormal(); + break; default: adjustWindowSizeBySceneRect(); break; diff --git a/app/settings.h b/app/settings.h index b79f770..1d92087 100644 --- a/app/settings.h +++ b/app/settings.h @@ -28,6 +28,7 @@ public: enum WindowSizeBehavior { Auto, Maximized, + Windowed, }; Q_ENUM(WindowSizeBehavior) diff --git a/app/settingsdialog.cpp b/app/settingsdialog.cpp index fb2efa6..c37ee34 100644 --- a/app/settingsdialog.cpp +++ b/app/settingsdialog.cpp @@ -86,7 +86,8 @@ SettingsDialog::SettingsDialog(QWidget *parent) static QList< QPair > _iws_options { { Settings::WindowSizeBehavior::Auto, tr("Auto size") }, - { Settings::WindowSizeBehavior::Maximized, tr("Maximized") } + { Settings::WindowSizeBehavior::Maximized, tr("Maximized") }, + { Settings::WindowSizeBehavior::Windowed, tr("Windowed") } }; static QList< QPair > _hidpi_options {