summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2014-07-17 17:21:02 +0200
committerJ-P Nurmi <jpnurmi@digia.com>2014-07-29 15:11:58 +0200
commit3dd107a6d22c801a741f9f40b6efbfd455a5ad6e (patch)
treeffe9f500397f91440ada8a7de51c15f5156b6655
parentbc43c7fc607b04b2efbd16815bd72e676c365f10 (diff)
downloadqtquickcontrols-3dd107a6d22c801a741f9f40b6efbfd455a5ad6e.tar.gz
MenuStyle: fix separator height
Let the delegate choose separator height instead of forcing a height calculated based on the font size, and check styleData.type instead of styleData.isSeparator that doesn't exist. Change-Id: Ia395a27ea86087f772606a252adf7565868ceac9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
-rw-r--r--src/controls/Styles/Base/MenuStyle.qml4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/controls/Styles/Base/MenuStyle.qml b/src/controls/Styles/Base/MenuStyle.qml
index 032cc74e..ceb2bfca 100644
--- a/src/controls/Styles/Base/MenuStyle.qml
+++ b/src/controls/Styles/Base/MenuStyle.qml
@@ -284,6 +284,7 @@ Style {
Will be used when \l {styleData properties} {styleData.type} equals \c MenuItemType.Separator.
*/
property Component separator: Item {
+ implicitHeight: styleRoot.font.pixelSize / 2
Rectangle {
width: parent.width - 2
height: 1
@@ -416,7 +417,7 @@ Style {
implicitWidth: Math.max((parent ? parent.width : 0),
Math.round(__leftLabelMargin + labelLoader.width + __rightLabelMargin +
(rightIndicatorLoader.active ? __minRightLabelSpacing + rightIndicatorLoader.width : 0)))
- implicitHeight: Math.round(styleData.isSeparator ? styleRoot.font.pixelSize / 2 :
+ implicitHeight: Math.round(styleData.type === MenuItemType.Separator ? separatorLoader.implicitHeight :
!!styleData.scrollerDirection ? styleRoot.font.pixelSize * 0.75 : labelLoader.height + 4)
Loader {
@@ -427,6 +428,7 @@ Style {
}
Loader {
+ id: separatorLoader
property alias styleData: panel.__styleData
property alias __currentTextColor: panel.currentTextColor
anchors.fill: parent