From 4f9f75cb4b70f3b76cee57d0f98b59f8475bba3b Mon Sep 17 00:00:00 2001
From: SineStriker <trueful@163.com>
Date: 周三, 27 12月 2023 05:56:28 +0800
Subject: [PATCH] Add mac theme notifications

---
 examples/mainwindow/mainwindow.cpp |   20 --------------------
 1 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/examples/mainwindow/mainwindow.cpp b/examples/mainwindow/mainwindow.cpp
index 6a7435e..206b7f2 100644
--- a/examples/mainwindow/mainwindow.cpp
+++ b/examples/mainwindow/mainwindow.cpp
@@ -14,15 +14,10 @@
 #  include <QtWidgets/QActionGroup>
 #endif
 
-#include <QWKCore/styleagent.h>
 #include <QWKWidgets/widgetwindowagent.h>
 
 #include <widgetframe/windowbar.h>
 #include <widgetframe/windowbutton.h>
-
-#ifdef Q_OS_WINDOWS
-#  include <QWKCore/qwindowkit_windows.h>
-#endif
 
 class ClockWidget : public QLabel {
 public:
@@ -41,7 +36,6 @@
 
 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
     installWindowAgent();
-    installStyleAgent();
 
     auto clockWidget = new ClockWidget();
     clockWidget->setObjectName(QStringLiteral("clock-widget"));
@@ -118,16 +112,6 @@
     // 1. Setup window agent
     windowAgent = new QWK::WidgetWindowAgent(this);
     windowAgent->setup(this);
-
-#ifdef Q_OS_WIN
-    if (QWK::IsWindows10OrGreater_Real() && !QWK::IsWindows11OrGreater_Real()) {
-        // windowAgent->setWindowAttribute(QStringLiteral("dark-mode"), true);
-
-        // https://github.com/microsoft/terminal/blob/71a6f26e6ece656084e87de1a528c4a8072eeabd/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp#L940
-        // Must call DWM API to extend top frame to client area
-        windowAgent->setWindowAttribute(QStringLiteral("extra-margins"), true);
-    }
-#endif
 
     // 2. Construct your title bar
     auto menuBar = [this]() {
@@ -302,10 +286,6 @@
     });
     connect(windowBar, &QWK::WindowBar::closeRequested, this, &QWidget::close);
 #endif
-}
-
-void MainWindow::installStyleAgent() {
-    styleAgent = new QWK::StyleAgent(this);
 }
 
 void MainWindow::loadStyleSheet(Theme theme) {

--
Gitblit v1.9.1