Skip to content

Commit

Permalink
Use a readonly property and document minimum item count limit
Browse files Browse the repository at this point in the history
  • Loading branch information
domi4484 committed Apr 23, 2024
1 parent f9a98b4 commit b0e7de8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/qml/editorwidgets/ValueMap.qml
Expand Up @@ -121,11 +121,15 @@ EditorWidgetBase {
Layout.preferredWidth: enabled ? 48 : 0
Layout.preferredHeight: 48

// Using the search when there are less than X items in the dropdown proves to be poor UI on normally
// sized and oriented phones. Some empirical tests proved 6 to be a good number for now.
readonly property int minimumItemCount: 6

bgcolor: "transparent"
iconSource: Theme.getThemeIcon("ic_baseline_search_black")
iconColor: Theme.mainTextColor

visible: enabled && comboBox.count > 6 // Make value map searchable only if it contains more than 6 items
visible: enabled && comboBox.count >= minimumItemCount

onClicked: {
searchFeaturePopup.open()
Expand Down

0 comments on commit b0e7de8

Please sign in to comment.