| | |
| | | windowBar->setHostWidget(this); |
| | | |
| | | agent->setTitleBar(windowBar); |
| | | agent->setSystemButton(QWK::CoreWindowAgent::WindowIcon, iconButton); |
| | | agent->setSystemButton(QWK::CoreWindowAgent::Minimize, minButton); |
| | | agent->setSystemButton(QWK::CoreWindowAgent::Maximize, maxButton); |
| | | agent->setSystemButton(QWK::CoreWindowAgent::Close, closeButton); |
| | | agent->setSystemButton(QWK::WindowAgentBase::WindowIcon, iconButton); |
| | | agent->setSystemButton(QWK::WindowAgentBase::Minimize, minButton); |
| | | agent->setSystemButton(QWK::WindowAgentBase::Maximize, maxButton); |
| | | agent->setSystemButton(QWK::WindowAgentBase::Close, closeButton); |
| | | agent->setHitTestVisible(menuBar, true); |
| | | |
| | | connect(windowBar, &QWK::WindowBar::minimizeRequested, this, &QWidget::showMinimized); |
| | |
| | | |
| | | auto clockWidget = new ClockWidget(); |
| | | clockWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
| | | connect(clockWidget, &QAbstractButton::clicked, this, [this]() { |
| | | if (!isMaximized()) { |
| | | showMaximized(); |
| | | } else { |
| | | showNormal(); |
| | | } |
| | | }); |
| | | |
| | | setMenuWidget(windowBar); |
| | | setCentralWidget(clockWidget); |
| | | setWindowTitle("Example MainWindow"); |
| | | // setContentsMargins({0, 1, 0, 0}); |
| | | resize(640, 480); |
| | | } |