Skip to content

Commit

Permalink
Avoid being able to 'unselect' a zoom item
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLazarescu committed Mar 29, 2024
1 parent c93d8bc commit faf1a0e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ function selectItem(index) {
}

if (newItem === listView.currentSelected) {
deselectCurrentItem()
if (root.allowUnselectingItems)
deselectCurrentItem()
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Item {
property alias text: selectionPopup.selectedContent
property bool multiSelect: false
property string boxBackgroundColor: Style.colorContainerBackground
property alias allowUnselectingItems: selectionPopup.allowUnselectingItems

property alias model: selectionPopup.model

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Popup {
property string contentPropertyName: "text"
property alias model: listView.model
property alias listView: listView
property bool allowUnselectingItems: true
property int itemHeight: 28
property int maxHeight: 208
property int defaultIndex: -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ Pane {
dropdownIcon: Icons.dropdownDark
dropdownIconSize: 9
checkBoxStyle: false
allowUnselectingItems: false
model: ListModel {
ListElement {
text: "15%"
Expand Down

0 comments on commit faf1a0e

Please sign in to comment.