feat: add combobox component

This commit is contained in:
talksik
2025-04-11 14:09:38 -07:00
parent c9a05a3c45
commit 10d3f77d94
4 changed files with 25 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import QtQuick
import QtQuick.Controls.Basic
import QtQuick.Controls.impl // Needed for features like the Control.blend() function
import DesignSystem
ComboBox {
id: control
editable: true
}
+2
View File
@@ -17,6 +17,8 @@ ApplicationWindow {
button: Theme.accent
midlight: Theme.card
light: Theme.secondaryText
highlight: Theme.muted
highlightedText: Theme.secondaryBackground
}
title: qsTr("Flowy")
+1
View File
@@ -23,6 +23,7 @@ set(plain_qml_files
AppLabel.qml
AppLogo.qml
AppWindow.qml
AppComboBox.qml
)
set(qml_singletons
Fonts.qml
+13
View File
@@ -80,5 +80,18 @@ AppWindow {
buttons: MessageDialog.Ok
text: "The document has been modified."
}
AppComboBox {
model: ListModel {
id: model
ListElement { text: "Banana" }
ListElement { text: "Apple" }
ListElement { text: "Coconut" }
}
onAccepted: {
if (find(editText) === -1)
model.append({text: editText})
}
}
}
}