@@ -30,7 +30,7 @@ T.ComboBox {
3030 rightPadding: padding + (control .mirrored || ! indicator || ! indicator .visible ? 0 : indicator .width + spacing)
3131
3232 delegate: MenuItem {
33- implicitWidth: ListView . view . width
33+ implicitWidth: Math . max ( DS . Style . control . implicitWidth (control), popup . implicitWidth - DS . Style . popup . margin * 2 )
3434 useIndicatorPadding: true
3535 text: control .textRole ? (Array .isArray (control .model ) ? modelData[control .textRole ] : (model[control .textRole ] === undefined ? modelData[control .textRole ] : model[control .textRole ])) : modelData
3636 icon .name : (control .iconNameRole && model[control .iconNameRole ] !== undefined ) ? model[control .iconNameRole ] : null
@@ -103,9 +103,12 @@ T.ComboBox {
103103 }
104104
105105 T .TextField {
106- Layout .fillWidth : true
106+ Layout .fillWidth : ! control . flat
107107 Layout .fillHeight : true
108+ implicitWidth: control .flat ? contentWidth : implicitBackgroundWidth + leftInset + rightInset
109+ || contentWidth + leftPadding + rightPadding
108110 Layout .rightMargin : DS .Style .comboBox .spacing
111+ Layout .alignment : control .flat ? Qt .AlignVCenter | Qt .AlignRight : Qt .AlignVCenter | Qt .AlignLeft
109112 text: control .editable ? control .editText : control .displayText
110113
111114 enabled: control .editable
@@ -124,7 +127,8 @@ T.ComboBox {
124127 }
125128
126129 background: Item {
127- implicitWidth: DS .Style .comboBox .width
130+ implicitWidth: control .flat ? control .implicitContentWidth + control .leftPadding + control .rightPadding
131+ : DS .Style .comboBox .width
128132 implicitHeight: DS .Style .comboBox .height
129133 Loader {
130134 anchors .fill : parent
@@ -156,8 +160,11 @@ T.ComboBox {
156160 }
157161
158162 popup: Popup {
163+ id: popup
164+ leftMargin: DS .Style .popup .margin
165+ rightMargin: DS .Style .popup .margin
159166 palette: control .palette
160- implicitWidth: control .width
167+ implicitWidth: control .flat ? Math . max ( contentItem . implicitWidth , control . width ) : control . width
161168 contentItem: ArrowListView {
162169 clip: true
163170 maxVisibleItems: control .maxVisibleItems
0 commit comments