diff --git a/AppComboBox.qml b/AppComboBox.qml new file mode 100644 index 0000000..5e7c175 --- /dev/null +++ b/AppComboBox.qml @@ -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 +} diff --git a/AppWindow.qml b/AppWindow.qml index 14ca6a2..be6648c 100644 --- a/AppWindow.qml +++ b/AppWindow.qml @@ -17,6 +17,8 @@ ApplicationWindow { button: Theme.accent midlight: Theme.card light: Theme.secondaryText + highlight: Theme.muted + highlightedText: Theme.secondaryBackground } title: qsTr("Flowy") diff --git a/CMakeLists.txt b/CMakeLists.txt index 2383b11..4224c20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ set(plain_qml_files AppLabel.qml AppLogo.qml AppWindow.qml + AppComboBox.qml ) set(qml_singletons Fonts.qml diff --git a/gallery/Main.qml b/gallery/Main.qml index b0d9084..4a109f8 100644 --- a/gallery/Main.qml +++ b/gallery/Main.qml @@ -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}) + } + } } }