From 5a34441c721b87a01e33964e030af6322bf74d14 Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Sun, 15 Dec 2024 19:12:38 +0800 Subject: [PATCH] feat: option to double-click to fullscreen Resolve: BLumia/pineapple-pictures#129 --- app/mainwindow.cpp | 4 ++++ app/settings.h | 1 + app/settingsdialog.cpp | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp index 698d8bc..59c3f3e 100644 --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -376,6 +376,10 @@ void MainWindow::mouseDoubleClickEvent(QMouseEvent *event) toggleMaximize(); event->accept(); break; + case Settings::DoubleClickBehavior::FullScreen: + toggleFullscreen(); + event->accept(); + break; case Settings::DoubleClickBehavior::Ignore: break; } diff --git a/app/settings.h b/app/settings.h index ea807b5..b79f770 100644 --- a/app/settings.h +++ b/app/settings.h @@ -15,6 +15,7 @@ class Settings : public QObject Ignore, Close, Maximize, + FullScreen, }; Q_ENUM(DoubleClickBehavior) diff --git a/app/settingsdialog.cpp b/app/settingsdialog.cpp index f5fc716..fb2efa6 100644 --- a/app/settingsdialog.cpp +++ b/app/settingsdialog.cpp @@ -75,7 +75,8 @@ SettingsDialog::SettingsDialog(QWidget *parent) static QList< QPair > _dc_options { { Settings::DoubleClickBehavior::Ignore, tr("Do nothing") }, { Settings::DoubleClickBehavior::Close, tr("Close the window") }, - { Settings::DoubleClickBehavior::Maximize, tr("Toggle maximize") } + { Settings::DoubleClickBehavior::Maximize, tr("Toggle maximize") }, + { Settings::DoubleClickBehavior::FullScreen, tr("Toggle fullscreen") } }; static QList< QPair > _mw_options {