2019-12-19 22:46:16 +11:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
2019-07-13 19:39:01 +10:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
2019-04-29 05:18:36 +10:00
|
|
|
import "../Base"
|
2019-03-26 18:19:55 +11:00
|
|
|
|
2019-12-09 05:43:41 +11:00
|
|
|
HDrawer {
|
2019-12-11 06:17:41 +11:00
|
|
|
id: mainPane
|
2019-12-11 07:29:49 +11:00
|
|
|
saveName: "mainPane"
|
2019-12-11 06:17:41 +11:00
|
|
|
color: theme.mainPane.background
|
2020-03-13 14:17:23 +11:00
|
|
|
minimumSize: bottomBar.addAccountButton.width
|
2019-07-24 16:14:34 +10:00
|
|
|
|
2020-03-10 20:41:40 +11:00
|
|
|
onHasFocusChanged:
|
|
|
|
if (! hasFocus) mainPaneList.detachedCurrentIndex = false
|
|
|
|
|
2019-07-16 22:36:11 +10:00
|
|
|
|
2020-03-13 14:17:23 +11:00
|
|
|
property alias filter: bottomBar.roomFilter
|
|
|
|
|
|
|
|
readonly property bool small:
|
|
|
|
width < theme.controls.avatar.size + theme.spacing * 2
|
|
|
|
|
2020-03-13 08:15:36 +11:00
|
|
|
readonly property bool hasFocus: bottomBar.filterField.activeFocus
|
2020-02-04 07:19:42 +11:00
|
|
|
readonly property alias mainPaneList: mainPaneList
|
2020-03-13 14:17:23 +11:00
|
|
|
readonly property alias topBar: topBar
|
2020-03-13 08:15:36 +11:00
|
|
|
readonly property alias bottomBar: bottomBar
|
2019-08-21 03:27:13 +10:00
|
|
|
|
|
|
|
|
2019-12-09 05:43:41 +11:00
|
|
|
function toggleFocus() {
|
2020-04-01 20:47:38 +11:00
|
|
|
if (mainPane.activeFocus) {
|
2019-12-09 05:43:41 +11:00
|
|
|
pageLoader.takeFocus()
|
|
|
|
return
|
2019-09-08 06:39:14 +10:00
|
|
|
}
|
|
|
|
|
2019-12-11 06:17:41 +11:00
|
|
|
mainPane.open()
|
2020-03-13 08:15:36 +11:00
|
|
|
bottomBar.filterField.forceActiveFocus()
|
2019-09-08 06:46:30 +10:00
|
|
|
}
|
2019-08-21 03:41:55 +10:00
|
|
|
|
2020-02-13 20:56:10 +11:00
|
|
|
function addccount() {
|
2020-03-13 08:15:36 +11:00
|
|
|
bottomBar.addAccountButton.clicked()
|
2020-02-13 20:56:10 +11:00
|
|
|
}
|
|
|
|
|
2019-08-21 03:41:55 +10:00
|
|
|
|
2019-12-16 19:42:41 +11:00
|
|
|
Behavior on opacity { HNumberAnimation {} }
|
2019-12-09 05:43:41 +11:00
|
|
|
|
2019-12-12 04:03:33 +11:00
|
|
|
Binding on visible {
|
2019-12-10 19:18:17 +11:00
|
|
|
value: false
|
|
|
|
when: ! mainUI.accountsPresent
|
|
|
|
}
|
|
|
|
|
2020-03-28 22:18:00 +11:00
|
|
|
HShortcut {
|
|
|
|
enabled: mainUI.accountsPresent
|
|
|
|
sequences: window.settings.keys.toggleFocusMainPane
|
|
|
|
onActivated: toggleFocus()
|
|
|
|
}
|
|
|
|
|
2019-04-29 05:18:36 +10:00
|
|
|
HColumnLayout {
|
2019-03-26 18:19:55 +11:00
|
|
|
anchors.fill: parent
|
|
|
|
|
2020-03-13 13:16:33 +11:00
|
|
|
TopBar {
|
2020-03-13 14:17:23 +11:00
|
|
|
id: topBar
|
|
|
|
|
2020-03-13 13:16:33 +11:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: false
|
|
|
|
Layout.preferredHeight: theme.baseElementsHeight
|
|
|
|
}
|
|
|
|
|
2019-12-03 07:29:29 +11:00
|
|
|
AccountRoomsList {
|
2019-12-11 06:17:41 +11:00
|
|
|
id: mainPaneList
|
2019-08-18 17:27:00 +10:00
|
|
|
clip: true
|
|
|
|
|
2019-03-26 18:19:55 +11:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
|
|
|
|
2020-03-13 08:15:36 +11:00
|
|
|
BottomBar {
|
|
|
|
id: bottomBar
|
2019-12-11 06:17:41 +11:00
|
|
|
mainPaneList: mainPaneList
|
2019-12-09 20:25:31 +11:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: false
|
|
|
|
Layout.preferredHeight: theme.baseElementsHeight
|
2019-07-03 03:59:52 +10:00
|
|
|
}
|
2019-03-26 18:19:55 +11:00
|
|
|
}
|
|
|
|
}
|