2020-09-23 19:57:54 -04:00
|
|
|
// Copyright Mirage authors & contributors <https://github.com/mirukana/mirage>
|
2020-05-13 07:37:39 -04:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
2020-09-17 18:16:54 -04:00
|
|
|
import ".."
|
2020-05-13 07:37:39 -04:00
|
|
|
import "../Base"
|
|
|
|
|
|
|
|
Rectangle {
|
2021-03-06 17:29:59 -04:00
|
|
|
property RoomList roomList
|
|
|
|
|
2020-05-13 07:37:39 -04:00
|
|
|
clip: true
|
2020-05-13 08:03:50 -04:00
|
|
|
implicitHeight: theme.baseElementsHeight
|
2020-05-13 08:24:53 -04:00
|
|
|
color: theme.mainPane.topBar.background
|
2020-05-13 07:37:39 -04:00
|
|
|
|
|
|
|
HRowLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
HButton {
|
|
|
|
backgroundColor: "transparent"
|
|
|
|
icon.name: "settings"
|
2020-09-16 22:59:20 -04:00
|
|
|
onClicked: settingsMenu.open()
|
2020-05-13 07:37:39 -04:00
|
|
|
|
|
|
|
Layout.fillHeight: true
|
2020-09-16 22:59:20 -04:00
|
|
|
|
|
|
|
HMenu {
|
|
|
|
id: settingsMenu
|
|
|
|
y: parent.height
|
|
|
|
|
2021-03-06 17:29:59 -04:00
|
|
|
HMenuItem {
|
|
|
|
icon.name: "add-account"
|
|
|
|
text: qsTr("Add another account")
|
|
|
|
onTriggered: {
|
|
|
|
pageLoader.show("Pages/AddAccount/AddAccount.qml")
|
|
|
|
roomList.startCorrectItemSearch()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-16 22:59:20 -04:00
|
|
|
HMenuItem {
|
|
|
|
icon.name: "more-settings"
|
2021-02-28 22:06:04 -04:00
|
|
|
text: qsTr("Open configuration folder")
|
2020-09-16 22:59:20 -04:00
|
|
|
onTriggered:
|
|
|
|
py.callCoro("get_config_dir", [], Qt.openUrlExternally)
|
|
|
|
}
|
|
|
|
|
|
|
|
HMenuItem {
|
|
|
|
icon.name: "theme"
|
|
|
|
text: qsTr("Open theme folder")
|
|
|
|
onTriggered:
|
|
|
|
py.callCoro("get_theme_dir", [], Qt.openUrlExternally)
|
|
|
|
}
|
|
|
|
|
2021-02-28 22:06:04 -04:00
|
|
|
HMenuItem {
|
|
|
|
icon.name: "documentation"
|
|
|
|
text: qsTr("Online documentation")
|
|
|
|
onTriggered: Qt.openUrlExternally(
|
2022-01-23 22:13:49 +01:00
|
|
|
"https://gitlab.com/mx-moment/moment/-/tree/main/docs"
|
2021-02-28 22:06:04 -04:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-09-16 22:59:20 -04:00
|
|
|
HMenuItem {
|
|
|
|
icon.name: "debug"
|
|
|
|
text: qsTr("Developer console")
|
|
|
|
onTriggered: mainUI.debugConsole.toggle()
|
|
|
|
}
|
|
|
|
}
|
2020-05-13 07:37:39 -04:00
|
|
|
}
|
|
|
|
|
2021-02-28 22:06:04 -04:00
|
|
|
HLabel {
|
|
|
|
horizontalAlignment: HLabel.AlignHCenter
|
|
|
|
verticalAlignment: HLabel.AlignVCenter
|
|
|
|
color: theme.mainPane.topBar.nameVersionLabel
|
2020-05-13 07:37:39 -04:00
|
|
|
text: qsTr("%1 %2")
|
|
|
|
.arg(Qt.application.displayName).arg(Qt.application.version)
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
|
|
|
|
|
|
|
HButton {
|
|
|
|
backgroundColor: "transparent"
|
|
|
|
|
2020-09-17 18:16:54 -04:00
|
|
|
icon.name:
|
2021-02-28 10:53:19 -04:00
|
|
|
mainUI.notificationLevel === UI.NotificationLevel.Enable ?
|
2021-02-28 11:42:51 -04:00
|
|
|
"notifications-enable" :
|
2020-09-17 18:16:54 -04:00
|
|
|
|
2021-02-28 10:53:19 -04:00
|
|
|
mainUI.notificationLevel === UI.NotificationLevel.Mute ?
|
2021-02-28 11:42:51 -04:00
|
|
|
"notifications-mute" :
|
2020-09-17 18:16:54 -04:00
|
|
|
|
2021-02-28 11:42:51 -04:00
|
|
|
"notifications-highlights-only"
|
2020-09-17 18:16:54 -04:00
|
|
|
|
|
|
|
icon.color:
|
2021-02-28 10:53:19 -04:00
|
|
|
mainUI.notificationLevel === UI.NotificationLevel.Enable ?
|
2020-09-17 18:16:54 -04:00
|
|
|
theme.icons.colorize :
|
|
|
|
|
2021-02-28 10:53:19 -04:00
|
|
|
mainUI.notificationLevel === UI.NotificationLevel.Mute ?
|
2020-09-17 18:16:54 -04:00
|
|
|
theme.colors.negativeBackground :
|
|
|
|
|
|
|
|
theme.colors.middleBackground
|
|
|
|
|
|
|
|
onClicked: notificationsMenu.open()
|
2020-05-13 07:37:39 -04:00
|
|
|
|
|
|
|
Layout.fillHeight: true
|
2020-09-17 18:16:54 -04:00
|
|
|
|
|
|
|
HMenu {
|
|
|
|
id: notificationsMenu
|
|
|
|
y: parent.height
|
|
|
|
|
|
|
|
HMenuItem {
|
2021-02-28 11:42:51 -04:00
|
|
|
icon.name: "notifications-enable"
|
2021-02-28 10:12:35 -04:00
|
|
|
text: qsTr("Enable notifications")
|
2021-02-28 11:38:48 -04:00
|
|
|
checkable: true
|
2021-02-28 10:12:35 -04:00
|
|
|
checked:
|
2021-02-28 10:53:19 -04:00
|
|
|
mainUI.notificationLevel ===
|
|
|
|
UI.NotificationLevel.Enable
|
2020-09-17 18:16:54 -04:00
|
|
|
onTriggered:
|
2021-02-28 10:53:19 -04:00
|
|
|
mainUI.notificationLevel =
|
|
|
|
UI.NotificationLevel.Enable
|
2020-09-17 18:16:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
HMenuItem {
|
2021-02-28 11:42:51 -04:00
|
|
|
icon.name: "notifications-highlights-only"
|
2021-02-28 11:41:15 -04:00
|
|
|
icon.color: theme.colors.middleBackground
|
2021-02-28 10:12:35 -04:00
|
|
|
text: qsTr("Highlights only (replies, keywords...)")
|
2021-02-28 11:38:48 -04:00
|
|
|
checkable: true
|
2021-02-28 10:12:35 -04:00
|
|
|
checked:
|
2021-02-28 10:53:19 -04:00
|
|
|
mainUI.notificationLevel ===
|
|
|
|
UI.NotificationLevel.HighlightsOnly
|
2020-09-17 18:16:54 -04:00
|
|
|
onTriggered:
|
2021-02-28 10:53:19 -04:00
|
|
|
mainUI.notificationLevel =
|
|
|
|
UI.NotificationLevel.HighlightsOnly
|
2020-09-17 18:16:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
HMenuItem {
|
2021-02-28 11:42:51 -04:00
|
|
|
icon.name: "notifications-mute"
|
2021-02-28 11:41:15 -04:00
|
|
|
icon.color: theme.colors.negativeBackground
|
2021-02-28 10:12:35 -04:00
|
|
|
text: qsTr("Mute all notifications")
|
2021-02-28 11:38:48 -04:00
|
|
|
checkable: true
|
2021-02-28 10:12:35 -04:00
|
|
|
checked:
|
2021-02-28 10:53:19 -04:00
|
|
|
mainUI.notificationLevel === UI.NotificationLevel.Mute
|
2020-09-17 18:16:54 -04:00
|
|
|
onTriggered:
|
2021-02-28 10:53:19 -04:00
|
|
|
mainUI.notificationLevel = UI.NotificationLevel.Mute
|
2020-09-17 18:16:54 -04:00
|
|
|
}
|
|
|
|
}
|
2020-05-13 07:37:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
HButton {
|
|
|
|
visible: Layout.preferredWidth > 0
|
|
|
|
backgroundColor: "transparent"
|
|
|
|
icon.name: "go-back-to-chat-from-main-pane"
|
2021-04-10 00:36:55 -04:00
|
|
|
toolTip.text: qsTr("Go to chat")
|
2020-05-13 07:37:39 -04:00
|
|
|
|
|
|
|
onClicked: mainPane.toggleFocus()
|
|
|
|
|
|
|
|
Layout.preferredWidth: mainPane.collapse ? implicitWidth : 0
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
Behavior on Layout.preferredWidth { HNumberAnimation {} }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|