From 8521bbf2f335984542f2071825d7383548862b7a Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <zhaoyuhang@rankyee.com> Date: 周三, 06 12月 2023 10:46:55 +0800 Subject: [PATCH] minor tweaks --- examples/mainwindow/mainwindow.cpp | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/mainwindow/mainwindow.cpp b/examples/mainwindow/mainwindow.cpp index 65c4b12..ae7cd16 100644 --- a/examples/mainwindow/mainwindow.cpp +++ b/examples/mainwindow/mainwindow.cpp @@ -32,8 +32,7 @@ void MainWindow::installWindowAgent() { auto agent = new QWK::WidgetWindowAgent(this); if (!agent->setup(this)) { - qDebug() << "Frameless handle failed to initialize."; - return; + qFatal("Frameless handle failed to initialize."); } auto titleLabel = new QLabel(); @@ -54,11 +53,17 @@ return menuBar; }(); + static const auto buttonStyleSheet = QLatin1String{ "QPushButton{color:black;};QPushButton:hover{background-color:black;color:white;}" }; + auto iconButton = new QPushButton("I"); + iconButton->setStyleSheet(buttonStyleSheet); auto minButton = new QPushButton("鈥�"); + minButton->setStyleSheet(buttonStyleSheet); auto maxButton = new QPushButton("馃棖"); + maxButton->setStyleSheet(buttonStyleSheet); maxButton->setCheckable(true); auto closeButton = new QPushButton("鉁�"); + closeButton->setStyleSheet(buttonStyleSheet); auto windowBar = new QWK::WindowBar(); windowBar->setIconButton(iconButton); -- Gitblit v1.9.1