Sine Striker
2023-12-27 b2471667e1377df998ec50a6f952f3d164e73e3d
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) {