diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2014-03-04 12:56:49 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-04 14:50:20 +0100 |
commit | 7f14c82d320303faee2593a2c414517d4f7634d0 (patch) | |
tree | aa1dcea79c78c73ad73a477ec6d72c585dcfdcf9 /src/controls/Styles/Desktop/MenuStyle.qml | |
parent | 39b5119a0cb1bc4b75c70666a6de25c8f2766314 (diff) | |
download | qtquickcontrols-7f14c82d320303faee2593a2c414517d4f7634d0.tar.gz |
MenuStyle: Fix popup margins for Desktop
Change-Id: Iacf17af64cc9df0518a7b29a4a7817d7c69d7539
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src/controls/Styles/Desktop/MenuStyle.qml')
-rw-r--r-- | src/controls/Styles/Desktop/MenuStyle.qml | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/controls/Styles/Desktop/MenuStyle.qml b/src/controls/Styles/Desktop/MenuStyle.qml index b44dd70d..886fed3d 100644 --- a/src/controls/Styles/Desktop/MenuStyle.qml +++ b/src/controls/Styles/Desktop/MenuStyle.qml @@ -54,10 +54,6 @@ Style { property Component frame: StyleItem { elementType: "menu" - contentWidth: parent ? Math.round(parent.contentWidth) : 0 - contentHeight: parent ? Math.round(parent.contentHeight) : 0 - width: implicitWidth + 2 * (pixelMetric("menuhmargin") + pixelMetric("menupanelwidth")) - height: implicitHeight + 2 * (pixelMetric("menuvmargin") + pixelMetric("menupanelwidth")) Rectangle { visible: anchors.margins > 0 anchors { @@ -69,16 +65,15 @@ Style { Accessible.role: Accessible.PopupMenu - Binding { - target: styleRoot - property: "submenuOverlap" - value: 2 * pixelMetric("menupanelwidth") - } - - Binding { - target: styleRoot - property: "margin" - value: pixelMetric("menuvmargin") + pixelMetric("menupanelwidth") + Component.onCompleted: { + var menuHMargin = pixelMetric("menuhmargin") + var menuVMargin = pixelMetric("menuvmargin") + var menuPanelWidth = pixelMetric("menupanelwidth") + styleRoot.padding.left = menuHMargin + menuPanelWidth + styleRoot.padding.right = menuHMargin + menuPanelWidth + styleRoot.padding.top = menuVMargin + menuPanelWidth + styleRoot.padding.bottom = menuVMargin + menuPanelWidth + styleRoot.submenuOverlap = 2 * menuPanelWidth } // ### The Screen attached property can only be set on an Item, |