moment/src/qml/SidePane/PaneToolBar.qml

46 lines
1.1 KiB
QML
Raw Normal View History

import QtQuick 2.12
import QtQuick.Layouts 1.12
import "../Base"
2019-03-26 09:29:46 +11:00
HRowLayout {
id: toolBar
2019-03-26 09:29:46 +11:00
property alias filterField: filterField
property alias roomFilter: filterField.text
Layout.fillWidth: true
Layout.preferredHeight: theme.baseElementsHeight
2019-03-26 09:29:46 +11:00
2019-07-11 05:03:05 +10:00
HUIButton {
iconName: "add-account"
backgroundColor: theme.sidePane.settingsButton.background
2019-07-07 07:29:32 +10:00
Layout.preferredHeight: parent.height
onClicked: pageStack.showPage("SignIn")
2019-04-29 05:13:18 +10:00
}
2019-03-26 09:29:46 +11:00
HTextField {
2019-03-26 09:29:46 +11:00
id: filterField
placeholderText: qsTr("Filter rooms")
backgroundColor: theme.sidePane.filterRooms.background
bordered: false
2019-03-26 09:29:46 +11:00
Layout.fillWidth: true
Layout.preferredHeight: parent.height
onTextChanged: {
if (window.uiState.sidePaneFilter == text) return
window.uiState.sidePaneFilter = text
window.uiStateChanged()
}
Connections {
target: window
// Keep multiple instances of PaneToolBar in sync.
// This also sets the text on startup.
onUiStateChanged: filterField.text = uiState.sidePaneFilter
}
2019-03-26 09:29:46 +11:00
}
}