summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2013-04-25 17:57:17 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-26 09:44:50 +0200
commit9307fa31ccd7408e53de3060e747083f9086e972 (patch)
tree12c1a8191fe1ccff0f18172c9b4bd33e4d737e9f
parentac97049201ac2869d6ad5e62b233f8f38ea3b6ff (diff)
downloadqtquickcontrols-9307fa31ccd7408e53de3060e747083f9086e972.tar.gz
MenuBar: Make widgets-less style work
Change-Id: I3a92408085d7d2aac663647d27b1f8d0f602b73e Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
-rw-r--r--src/controls/MenuBar.qml1
-rw-r--r--src/styles/MenuBarStyle.qml14
-rw-r--r--src/styles/MenuStyle.qml2
3 files changed, 9 insertions, 8 deletions
diff --git a/src/controls/MenuBar.qml b/src/controls/MenuBar.qml
index 226e304e..80662c85 100644
--- a/src/controls/MenuBar.qml
+++ b/src/controls/MenuBar.qml
@@ -94,7 +94,6 @@ MenuBarPrivate {
onStatusChanged: if (status === Loader.Error) console.error("Failed to load panel for", root)
visible: status === Loader.Ready
- active: !root.isNative
sourceComponent: __style ? __style.frame : undefined
Loader {
diff --git a/src/styles/MenuBarStyle.qml b/src/styles/MenuBarStyle.qml
index 6b7950eb..2212732a 100644
--- a/src/styles/MenuBarStyle.qml
+++ b/src/styles/MenuBarStyle.qml
@@ -48,25 +48,27 @@ import QtQuick.Controls.Styles 1.0
*/
Style {
- property var __syspal: SystemPalette { id: syspal }
+ readonly property color __backgroundColor: "#dcdcdc"
- property Component panel: Rectangle {
- width: control.width
+ property Component frame: Rectangle {
+ width: control.__contentItem.width
height: 20
- color: __syspal.window
+ color: __backgroundColor
}
property Component menuItem: Rectangle {
width: text.width + 12
height: text.height + 4
- color: selected ? __syspal.highlight : __syspal.window
+ color: sunken ? "#49d" :__backgroundColor
+
+ SystemPalette { id: syspal }
Text {
id: text
text: menuItem.title
anchors.centerIn: parent
renderType: Text.NativeRendering
- color: selected ? __syspal.highlightedText : __syspal.windowText
+ color: sunken ? "white" : syspal.windowText
}
}
}
diff --git a/src/styles/MenuStyle.qml b/src/styles/MenuStyle.qml
index deddb73d..78d67540 100644
--- a/src/styles/MenuStyle.qml
+++ b/src/styles/MenuStyle.qml
@@ -68,7 +68,7 @@ Style {
border.color: selected && enabled ? Qt.darker(selectedColor, 1) : color
readonly property int leftMargin: __menuItemType === "menuitem" ? 18 : 0
- readonly property color backgroundColor: "lightgray"
+ readonly property color backgroundColor: "#dcdcdc"
readonly property color selectedColor: "#49d"
Gradient {
id: selectedGradient