From 1c90f5386d95acbef11b70869897c487f4fe0e6e Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 25 Apr 2016 21:04:53 +0200 Subject: Material: revise ComboBox looks Increase the default height to 48dip, which is also the height of ItemDelegate. Open the popup on top instead of below the button, and sync paddings with ItemDelegate so that ComboBox and ItemDelegate contents match. Also, visualize the current item by highlighting its text with accent color. Change-Id: Iabbcb07e5c4fd1f811857f3c04aadcf87accb41f Reviewed-by: Mitch Curtis --- src/imports/controls/material/ComboBox.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index 8b3ae358..49f4554e 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -51,12 +51,13 @@ T.ComboBox { baselineOffset: contentItem.y + contentItem.baselineOffset spacing: 6 - padding: 12 + padding: 16 //! [delegate] delegate: MenuItem { width: control.width text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData + Material.foreground: control.currentIndex === index ? control.Material.accent : control.Material.foreground highlighted: control.highlightedIndex === index } //! [delegate] @@ -76,7 +77,7 @@ T.ComboBox { //! [background] background: Rectangle { implicitWidth: 120 - implicitHeight: 32 + implicitHeight: 48 radius: 2 color: control.Material.dialogColor @@ -114,7 +115,6 @@ T.ComboBox { //! [popup] popup: T.Popup { - y: control.height implicitWidth: control.width implicitHeight: listview.contentHeight transformOrigin: Item.Top -- cgit v1.2.3