From e0b59294fc9e9dc8198b8c504860353b6bec0124 Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周二, 07 5月 2024 21:14:12 +0800 Subject: [PATCH] Implement Windows SysMenu handling --- examples/mainwindow/mainwindow.cpp | 18 ------------------ 1 files changed, 0 insertions(+), 18 deletions(-) diff --git a/examples/mainwindow/mainwindow.cpp b/examples/mainwindow/mainwindow.cpp index 4021ec3..c704812 100644 --- a/examples/mainwindow/mainwindow.cpp +++ b/examples/mainwindow/mainwindow.cpp @@ -321,24 +321,6 @@ setMenuWidget(windowBar); - // 3. Adds simulated mouse events to the title bar buttons -#ifdef Q_OS_WINDOWS - // Emulate Window system menu button behaviors - connect(iconButton, &QAbstractButton::clicked, windowAgent, [this, iconButton] { - iconButton->setProperty("double-click-close", false); - - // Pick a suitable time threshold - QTimer::singleShot(75, windowAgent, [this, iconButton]() { - if (iconButton->property("double-click-close").toBool()) - return; - windowAgent->showSystemMenu(iconButton->mapToGlobal(QPoint{0, iconButton->height()})); - }); - }); - connect(iconButton, &QWK::WindowButton::doubleClicked, this, [iconButton, this]() { - iconButton->setProperty("double-click-close", true); - close(); - }); -#endif #ifndef Q_OS_MAC connect(windowBar, &QWK::WindowBar::minimizeRequested, this, &QWidget::showMinimized); -- Gitblit v1.9.1