diff --git a/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectNodesComboBox.qml b/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectNodesComboBox.qml index 0aca7a89089..42265970787 100644 --- a/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectNodesComboBox.qml +++ b/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectNodesComboBox.qml @@ -78,7 +78,7 @@ StudioControls.ComboBox { flags: Qt.Dialog | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint onActiveFocusItemChanged: { - if (!window.activeFocusItem && !root.indicator.hover && root.popup.opened) + if (!window.activeFocusItem && !root.hovered && root.popup.opened) root.popup.close() } @@ -87,6 +87,7 @@ StudioControls.ComboBox { color: StudioTheme.Values.themePanelBackground border.color: StudioTheme.Values.themeInteraction border.width: 1 + focus: true HelperWidgets.ScrollView { anchors.fill: parent @@ -126,6 +127,11 @@ StudioControls.ComboBox { } } } + + Keys.onPressed: function(event) { + if (event.key === Qt.Key_Escape && root.popup.opened) + root.popup.close() + } } } } diff --git a/share/qtcreator/qmldesigner/effectMakerQmlSources/PreviewImagesComboBox.qml b/share/qtcreator/qmldesigner/effectMakerQmlSources/PreviewImagesComboBox.qml index 02e43ea10c7..feadaa1d940 100644 --- a/share/qtcreator/qmldesigner/effectMakerQmlSources/PreviewImagesComboBox.qml +++ b/share/qtcreator/qmldesigner/effectMakerQmlSources/PreviewImagesComboBox.qml @@ -90,6 +90,20 @@ StudioControls.ComboBox { anchors.fill: parent anchors.margins: 1 } + + MouseArea { + anchors.fill: parent + enabled: true + acceptedButtons: Qt.LeftButton + cursorShape: Qt.PointingHandCursor + onPressed: (mouse) => { + if (root.popup.opened) + root.popup.close() + else + root.popup.open() + mouse.accepted = true + } + } } Window { @@ -98,7 +112,7 @@ StudioControls.ComboBox { flags: Qt.Dialog | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint onActiveFocusItemChanged: { - if (!window.activeFocusItem && !root.indicator.hover && root.popup.opened) + if (!window.activeFocusItem && !root.hovered && root.popup.opened) root.popup.close() } @@ -107,6 +121,7 @@ StudioControls.ComboBox { color: StudioTheme.Values.themePanelBackground border.color: StudioTheme.Values.themeInteraction border.width: 1 + focus: true HelperWidgets.ScrollView { anchors.fill: parent @@ -153,6 +168,11 @@ StudioControls.ComboBox { } } } + + Keys.onPressed: function(event) { + if (event.key === Qt.Key_Escape && root.popup.opened) + root.popup.close() + } } } }