2019-12-19 07:46:16 -04:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
2019-08-15 11:29:22 -04:00
|
|
|
import QtQuick 2.12
|
2019-07-13 05:39:01 -04:00
|
|
|
import QtQuick.Layouts 1.12
|
2019-04-28 15:18:36 -04:00
|
|
|
import "../Base"
|
2019-03-25 18:29:46 -04:00
|
|
|
|
2019-04-28 15:18:36 -04:00
|
|
|
HRowLayout {
|
2019-04-20 17:45:51 -04:00
|
|
|
id: toolBar
|
2019-12-15 14:56:40 -04:00
|
|
|
// Hide filter field overflowing for a sec on size changes
|
|
|
|
clip: true
|
2019-03-25 18:29:46 -04:00
|
|
|
|
2019-12-02 16:29:29 -04:00
|
|
|
property AccountRoomsList mainPaneList
|
2019-08-23 11:02:22 -04:00
|
|
|
readonly property alias addAccountButton: addAccountButton
|
|
|
|
readonly property alias filterField: filterField
|
2019-07-02 13:59:52 -04:00
|
|
|
property alias roomFilter: filterField.text
|
|
|
|
|
2019-08-20 17:41:24 -04:00
|
|
|
HButton {
|
2019-08-23 11:02:22 -04:00
|
|
|
id: addAccountButton
|
2019-08-21 15:45:13 -04:00
|
|
|
icon.name: "add-account"
|
2019-08-22 09:27:26 -04:00
|
|
|
toolTip.text: qsTr("Add another account")
|
2019-12-10 15:17:41 -04:00
|
|
|
backgroundColor: theme.mainPane.settingsButton.background
|
2020-02-13 05:56:10 -04:00
|
|
|
onClicked: {
|
|
|
|
mainPaneList.clearSelection()
|
|
|
|
pageLoader.showPage("AddAccount/AddAccount")
|
|
|
|
}
|
2019-08-20 17:41:24 -04:00
|
|
|
|
2019-08-22 09:27:26 -04:00
|
|
|
Layout.fillHeight: true
|
2019-04-28 15:13:18 -04:00
|
|
|
}
|
2019-03-25 18:29:46 -04:00
|
|
|
|
2019-04-28 15:18:36 -04:00
|
|
|
HTextField {
|
2019-03-25 18:29:46 -04:00
|
|
|
id: filterField
|
2019-12-10 16:29:49 -04:00
|
|
|
saveName: "roomFilterField"
|
|
|
|
|
2019-03-25 18:29:46 -04:00
|
|
|
placeholderText: qsTr("Filter rooms")
|
2019-12-10 15:17:41 -04:00
|
|
|
backgroundColor: theme.mainPane.filterRooms.background
|
2019-07-18 20:39:13 -04:00
|
|
|
bordered: false
|
2019-12-15 14:56:40 -04:00
|
|
|
opacity: width >= 16 * theme.uiScale ? 1 : 0
|
2019-04-28 12:08:54 -04:00
|
|
|
|
2019-12-08 14:43:41 -04:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
2019-12-10 15:17:41 -04:00
|
|
|
Keys.onUpPressed: mainPaneList.previous(false) // do not activate
|
|
|
|
Keys.onDownPressed: mainPaneList.next(false)
|
2019-12-08 14:43:41 -04:00
|
|
|
|
|
|
|
Keys.onEnterPressed: Keys.onReturnPressed(event)
|
|
|
|
Keys.onReturnPressed: {
|
|
|
|
if (event.modifiers & Qt.ShiftModifier) {
|
2019-12-10 15:17:41 -04:00
|
|
|
mainPaneList.toggleCollapseAccount()
|
2019-12-08 14:43:41 -04:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if (window.settings.clearRoomFilterOnEnter) text = ""
|
2019-12-10 15:17:41 -04:00
|
|
|
mainPaneList.activate()
|
2019-08-15 11:29:22 -04:00
|
|
|
}
|
|
|
|
|
2019-12-08 14:43:41 -04:00
|
|
|
Keys.onEscapePressed: {
|
|
|
|
if (window.settings.clearRoomFilterOnEscape) text = ""
|
|
|
|
mainUI.pageLoader.forceActiveFocus()
|
|
|
|
}
|
2019-12-15 14:56:40 -04:00
|
|
|
|
2019-12-16 04:42:41 -04:00
|
|
|
Behavior on opacity { HNumberAnimation {} }
|
2019-03-25 18:29:46 -04:00
|
|
|
}
|
|
|
|
}
|