feat: add combobox component
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
@@ -17,6 +17,8 @@ ApplicationWindow {
|
|||||||
button: Theme.accent
|
button: Theme.accent
|
||||||
midlight: Theme.card
|
midlight: Theme.card
|
||||||
light: Theme.secondaryText
|
light: Theme.secondaryText
|
||||||
|
highlight: Theme.muted
|
||||||
|
highlightedText: Theme.secondaryBackground
|
||||||
}
|
}
|
||||||
|
|
||||||
title: qsTr("Flowy")
|
title: qsTr("Flowy")
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ set(plain_qml_files
|
|||||||
AppLabel.qml
|
AppLabel.qml
|
||||||
AppLogo.qml
|
AppLogo.qml
|
||||||
AppWindow.qml
|
AppWindow.qml
|
||||||
|
AppComboBox.qml
|
||||||
)
|
)
|
||||||
set(qml_singletons
|
set(qml_singletons
|
||||||
Fonts.qml
|
Fonts.qml
|
||||||
|
|||||||
@@ -80,5 +80,18 @@ AppWindow {
|
|||||||
buttons: MessageDialog.Ok
|
buttons: MessageDialog.Ok
|
||||||
text: "The document has been modified."
|
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})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user