85 lines
1.8 KiB
QML
85 lines
1.8 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
|
|
|
|
Item
|
|
{
|
|
id: searchBar
|
|
height: 30
|
|
TextField
|
|
{
|
|
id: searchField
|
|
placeholderText: qsTr("Suche")
|
|
leftPadding: 3
|
|
rightPadding: 3
|
|
width: 300
|
|
|
|
|
|
Button
|
|
{
|
|
icon.source: "../images/search.svg"
|
|
icon.color: "olive"
|
|
anchors.right: parent.right
|
|
height: parent.height
|
|
flat: true
|
|
|
|
}
|
|
}
|
|
Button
|
|
{
|
|
id: filterBtn
|
|
icon.source: "../images/filter.svg"
|
|
icon.color: "olive"
|
|
anchors.left: searchField.right
|
|
height: searchField.height
|
|
flat: true
|
|
onClicked: filterPopup.open()
|
|
|
|
|
|
}
|
|
Popup
|
|
{
|
|
id: filterPopup
|
|
x: filterBtn.x + filterBtn.width
|
|
y: filterBtn.y
|
|
width: 100
|
|
height: 150
|
|
modal: true
|
|
focus: true
|
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
|
contentItem: Item
|
|
{
|
|
|
|
ColumnLayout
|
|
{
|
|
anchors.fill: parent
|
|
//id: filterContent
|
|
|
|
Repeater
|
|
{
|
|
model: availableFilters
|
|
CheckBox
|
|
{
|
|
text: model.modelData
|
|
onClicked:
|
|
{
|
|
setFilter(text, checkState)
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function setFilter(filter,activated)
|
|
{
|
|
console.log(filter)
|
|
console.log(activated)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|