diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-04-25 21:04:53 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-04-26 13:30:51 +0000 |
commit | 1c90f5386d95acbef11b70869897c487f4fe0e6e (patch) | |
tree | f5ff3b0ea0bbb53d80157686679a37c15ac084fb | |
parent | 138399e7e999a33ebdf88de53ccd9c68c4bc61af (diff) |
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 <mitch.curtis@theqtcompany.com>
-rw-r--r-- | src/imports/controls/material/ComboBox.qml | 6 |
1 files 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 |