From e4ad9cb48cf7418604626f820f8cbf73ae8de33f Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Tue, 15 Nov 2022 14:08:47 +0100 Subject: [PATCH] Move base hovered logic out of ComboBox.qml since base is undefined in most places the component is used. CURA-9424 --- plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml | 1 + resources/qml/Settings/SettingComboBox.qml | 1 + resources/qml/Settings/SettingExtruder.qml | 2 ++ resources/qml/Settings/SettingOptionalExtruder.qml | 1 + resources/qml/Widgets/ComboBox.qml | 3 ++- 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index 2d4b3e01e5..be7aebcf7a 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -150,6 +150,7 @@ Item width: parent.width / 2 - UM.Theme.getSize("default_margin").width height: UM.Theme.getSize("setting_control").height textRole: "text" + forceHighlight: base.hovered model: ListModel { diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index cbabb3ffd4..c57c0a1548 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -18,6 +18,7 @@ SettingItem model: definition.options textRole: "value" + forceHighlight: base.hovered anchors.fill: parent diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index 567161b8f6..63413aa9bd 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -17,6 +17,8 @@ SettingItem id: control anchors.fill: parent + forceHighlight: base.hovered + property var extrudersModel: CuraApplication.getExtrudersModel() model: extrudersModel diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 22f03d44a2..a9fdc626b9 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -23,6 +23,7 @@ SettingItem { id: control anchors.fill: parent + forceHighlight: base.hovered model: base.extrudersWithOptionalModel diff --git a/resources/qml/Widgets/ComboBox.qml b/resources/qml/Widgets/ComboBox.qml index a7eeb33f6a..06ac2425bb 100644 --- a/resources/qml/Widgets/ComboBox.qml +++ b/resources/qml/Widgets/ComboBox.qml @@ -19,6 +19,7 @@ ComboBox property var defaultTextOnEmptyIndex: "" // Text displayed in the combobox when the model has items but no item is selected property alias textFormat: contentLabel.textFormat property alias backgroundColor: background.color + property bool forceHighlight: false enabled: delegateModel.count > 0 @@ -46,7 +47,7 @@ ComboBox State { name: "highlighted" - when: ((base != undefined && base.hovered) || control.hovered) && !control.activeFocus + when: (control.hovered && !control.activeFocus) || forceHighlight PropertyChanges { target: background