| | |
| | | # include <QtWidgets/QActionGroup> |
| | | #endif |
| | | |
| | | #include <QWKCore/styleagent.h> |
| | | #include <QWKWidgets/widgetwindowagent.h> |
| | | |
| | | #include <widgetframe/windowbar.h> |
| | |
| | | |
| | | MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { |
| | | installWindowAgent(); |
| | | installStyleAgent(); |
| | | |
| | | auto clockWidget = new ClockWidget(); |
| | | clockWidget->setObjectName(QStringLiteral("clock-widget")); |
| | |
| | | // 1. Setup window agent |
| | | windowAgent = new QWK::WidgetWindowAgent(this); |
| | | windowAgent->setup(this); |
| | | |
| | | #ifdef Q_OS_WIN |
| | | windowAgent->setWindowAttribute(QStringLiteral("dark-mode"), true); |
| | | #endif |
| | | |
| | | // 2. Construct your title bar |
| | | auto menuBar = [this]() { |
| | |
| | | }); |
| | | connect(windowBar, &QWK::WindowBar::closeRequested, this, &QWidget::close); |
| | | #endif |
| | | } |
| | | |
| | | void MainWindow::installStyleAgent() { |
| | | styleAgent = new QWK::StyleAgent(this); |
| | | } |
| | | |
| | | void MainWindow::loadStyleSheet(Theme theme) { |