Skip to content

Commit

Permalink
Fix highlight issue when default was selected.
Browse files Browse the repository at this point in the history
toggleButtons.selectedIndex must be bind with comboBox.currentIndex, but in some cases that binding was broken by assignment, so we removed that assignment and binding will be back.
  • Loading branch information
mohsenD98 authored and nirvn committed Jun 15, 2024
1 parent 038c06d commit 64627ca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/qml/editorwidgets/ValueMap.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ EditorWidgetBase {
// Workaround to get a signal when the value has changed
onCurrentKeyValueChanged: {
comboBox.currentIndex = comboBox.model.keyToIndex(currentKeyValue)
toggleButtons.selectedIndex = comboBox.currentIndex
}

height: childrenRect.height
Expand Down Expand Up @@ -131,7 +130,7 @@ EditorWidgetBase {

Behavior on color {
ColorAnimation {
duration: 200
duration: 150
}
}

Expand All @@ -150,11 +149,11 @@ EditorWidgetBase {
anchors.fill: parent
onClicked: {
if (toggleButtons.selectedIndex != index) {
toggleButtons.selectedIndex = index
comboBox.currentIndex = index
toggleButtons.currentSelectedKey = key
toggleButtons.currentSelectedValue = value
} else {
toggleButtons.selectedIndex = -1
comboBox.currentIndex = -1
toggleButtons.currentSelectedKey = ""
toggleButtons.currentSelectedValue = ""
}
Expand Down

1 comment on commit 64627ca

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.