diff options
author | Wladimir Leuschner <[email protected]> | 2025-03-11 15:48:13 +0100 |
---|---|---|
committer | Wladimir Leuschner <[email protected]> | 2025-03-17 16:03:22 +0000 |
commit | b24b9bba68821d4abb905d434e4b9442c65ff0c6 (patch) | |
tree | 0ca9cf4faf923ea3973d0e4546fcaf039f66661c | |
parent | 39ec71237f79f1a1aecd278b8c610e70c9cd1c67 (diff) |
WindowsQPA: Adjust close button and hover color for custom titlebar
Adjust toe color of the close button to match the native color. Adjust
the hover text color for the close in light mode to match the native
behavior.
Fixes: QTBUG-133945
Pick-to: 6.9
Change-Id: I2c9fafba9fee65f45f3878168b67b0d0a4b2a54c
Reviewed-by: Tor Arne Vestbø <[email protected]>
Reviewed-by: Oliver Wolff <[email protected]>
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 449036fd37f..fba0c620745 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -3500,7 +3500,7 @@ void QWindowsWindow::updateCustomTitlebar() qApp->styleHints()->colorScheme() == Qt::ColorScheme::Dark; const bool isWindows11orAbove = QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows11; - const QBrush closeButtonBrush(QColor(0xC4, 0x2B, 0x1C, 255)); + const QBrush closeButtonBrush(QColor(0xC4, 0x2C, 0x1E, 255)); const QBrush minMaxButtonBrush = QBrush(isDarkmode ? QColor(0xFF, 0xFF, 0xFF, 0x40) : QColor(0x00, 0x00, 0x00, 0x20)); const QBrush titleBarBackgroundColor = QBrush(isDarkmode ? QColor(0x1F, 0x1F, 0x1F, 0xFF) : QColor(0xF3, 0xF3, 0xF3, 0xFF)); const QPen textPen = QPen(isDarkmode ? QColor(0xFF, 0xFF, 0xFD, 0xFF) : QColor(0x00, 0x00, 0x00, 0xFF)); @@ -3584,9 +3584,12 @@ void QWindowsWindow::updateCustomTitlebar() _q_drawCustomTitleBarButton(p, rect); else p.drawRect(rect); + const QPen closeButtonHoveredPen = QPen(QColor(0xFF, 0xFF, 0xFD, 0xFF)); + p.setPen(closeButtonHoveredPen); + } else { + p.setPen(textPen); } - p.setPen(textPen); - p.drawText(rect,QStringLiteral("\uE8BB"), QTextOption(Qt::AlignVCenter | Qt::AlignHCenter)); + p.drawText(rect, QStringLiteral("\uE8BB"), QTextOption(Qt::AlignVCenter | Qt::AlignHCenter)); buttons++; } |