moment/src/qml/SidePane/SidePaneToolBar.qml

50 lines
1.3 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
2019-08-24 01:02:22 +10:00
readonly property alias addAccountButton: addAccountButton
readonly property alias filterField: filterField
property alias roomFilter: filterField.text
Layout.fillWidth: true
Layout.minimumHeight: theme.baseElementsHeight
Layout.maximumHeight: Layout.minimumHeight
2019-03-26 09:29:46 +11:00
2019-08-21 07:41:24 +10:00
HButton {
2019-08-24 01:02:22 +10:00
id: addAccountButton
icon.name: "add-account"
toolTip.text: qsTr("Add another account")
backgroundColor: theme.sidePane.settingsButton.background
onClicked: pageLoader.showPage("SignIn")
2019-08-21 07:41:24 +10:00
Layout.fillHeight: true
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.fillHeight: true
onTextChanged: {
if (window.uiState.sidePaneFilter == text) return
window.uiState.sidePaneFilter = text
window.uiStateChanged()
}
Connections {
target: window
2019-08-31 01:05:11 +10:00
// Keep multiple instances of SidePaneToolBar in sync.
// This also sets the text on startup.
onUiStateChanged: filterField.text = uiState.sidePaneFilter
}
2019-03-26 09:29:46 +11:00
}
}