aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Eftevaag <oliver.eftevaag@qt.io>2025-02-20 15:03:05 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2025-02-28 10:37:17 +0000
commit6add0bdb3f1c09f4526eed32a422c23dd625e528 (patch)
treeb7f349dcbd6ede388173187a92c55521b22a991e
parentd994fe6208e436d5d4456cb7ceaa0b8e4f4e15b3 (diff)
Change background color of the Windows style MenuBar
The background color was hard coded to be white, which prevented it from adapting to dark mode and high contrast theme changes. Use button background color instead, since native windows applications appears to use the same color for both button and menubar backgrounds. It's also the color role we're assigning to in menubarPalette() in qwindowstheme.cpp Task-number: QTBUG-133595 Change-Id: Ic9fdaebb2b38c125b223a5599396d93463ac9cd1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 67844ae00bff9995e5cc968dfa8532db23fe68d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 35c204b862b8590decc3e1b62a5228a74a1b95f7)
-rw-r--r--src/quickcontrols/windows/MenuBar.qml2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quickcontrols/windows/MenuBar.qml b/src/quickcontrols/windows/MenuBar.qml
index ec998abde7..daab9210d2 100644
--- a/src/quickcontrols/windows/MenuBar.qml
+++ b/src/quickcontrols/windows/MenuBar.qml
@@ -30,6 +30,6 @@ T.MenuBar {
background: Rectangle {
implicitHeight: 20
- color: "white" // window title bar color
+ color: control.palette.button // The MenuBar shares the same color as the MenuBarItems on Windows
}
}