summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2014-07-28 13:08:59 +0200
committerJ-P Nurmi <jpnurmi@digia.com>2014-07-28 15:19:43 +0200
commit0d2a1d22aa9be63c7f751e822140238fc52936fa (patch)
tree355fd5ac6cd349e6ef1754c610c1bb2dfb22e9c1
parentf1e78a983829e26ae0b6f43268cf194c7bc67de1 (diff)
downloadqtquickcontrols-0d2a1d22aa9be63c7f751e822140238fc52936fa.tar.gz
ComboBox: respect style padding for the editor
Get rid of the hard coded 8px left margin and use whatever value the style supplies (and is already used for the label). This allows the Android style to provide a sensible value for High DPI screens. The new value for the left margin is 6px in Base and Desktop styles. It looks slightly better, but still not pixel perfect. Notice that the text label of editable and non-editable ComboBoxes are not perfectly aligned in native Windows and OS X ComboBoxes either. Change-Id: I9a66c3a26fcd9ef1653b355e831277a7b6cbe72f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
-rw-r--r--src/controls/ComboBox.qml6
-rw-r--r--src/controls/Styles/Desktop/ComboBoxStyle.qml1
2 files changed, 5 insertions, 2 deletions
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml
index 768077a9..82d718c3 100644
--- a/src/controls/ComboBox.qml
+++ b/src/controls/ComboBox.qml
@@ -394,8 +394,10 @@ Control {
selectionHandle: __style ? __style.selectionHandle : undefined
anchors.fill: parent
- anchors.leftMargin: 8
- anchors.rightMargin: __panel.dropDownButtonWidth + __style.padding.right
+ anchors.leftMargin: __style ? __style.padding.left : 0
+ anchors.topMargin: __style ? __style.padding.top : 0
+ anchors.rightMargin: __style ? __panel.dropDownButtonWidth + __style.padding.right : 0
+ anchors.bottomMargin: __style ? __style.padding.bottom: 0
verticalAlignment: Text.AlignVCenter
diff --git a/src/controls/Styles/Desktop/ComboBoxStyle.qml b/src/controls/Styles/Desktop/ComboBoxStyle.qml
index c644544f..d897a2a4 100644
--- a/src/controls/Styles/Desktop/ComboBoxStyle.qml
+++ b/src/controls/Styles/Desktop/ComboBoxStyle.qml
@@ -46,6 +46,7 @@ import "." as Desktop
Style {
readonly property ComboBox control: __control
property int renderType: Text.NativeRendering
+ padding { top: 4 ; left: 6 ; right: 6 ; bottom:4 }
property Component panel: Item {
property bool popup: !!styleItem.styleHint("comboboxpopup")
property color textColor: SystemPaletteSingleton.text(control.enabled)