forked from qt-creator/qt-creator
QmlDesigner: Fix editable ComboBox popup selection
This patch introduces a new state called 'popup' to disable text editing while the popup is opened and enables text editing whenever the popup is closed. Task-number: QDS-1262 Change-Id: I74ad4723d2cfe81447e94c37e9ba1f0913790d97 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Thomas Hartmann
parent
05bb285b0d
commit
bec91cbad8
@@ -244,7 +244,7 @@ T.ComboBox {
|
|||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "edit"
|
name: "edit"
|
||||||
when: myComboBox.edit && myComboBox.editable
|
when: myComboBox.edit && myComboBox.editable && !comboBoxPopup.opened
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: myComboBox
|
target: myComboBox
|
||||||
wheelEnabled: true
|
wheelEnabled: true
|
||||||
@@ -252,12 +252,29 @@ T.ComboBox {
|
|||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: comboBoxInput
|
target: comboBoxInput
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
|
readOnly: false
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: comboBoxBackground
|
target: comboBoxBackground
|
||||||
color: StudioTheme.Values.themeInteraction
|
color: StudioTheme.Values.themeInteraction
|
||||||
border.color: StudioTheme.Values.themeInteraction
|
border.color: StudioTheme.Values.themeInteraction
|
||||||
}
|
}
|
||||||
|
StateChangeScript {
|
||||||
|
script: comboBoxPopup.close()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "popup"
|
||||||
|
when: myComboBox.edit && comboBoxPopup.opened
|
||||||
|
PropertyChanges {
|
||||||
|
target: myComboBox
|
||||||
|
wheelEnabled: true
|
||||||
|
}
|
||||||
|
PropertyChanges {
|
||||||
|
target: comboBoxInput
|
||||||
|
selectByMouse: false
|
||||||
|
readOnly: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user