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 {
|
|
|
|
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
|
|
|
toolTip.text: qsTr("Settings")
|
|
|
|
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
|
|
|
|
|
|
|
|
HMenuItem {
|
|
|
|
icon.name: "more-settings"
|
|
|
|
text: qsTr("Open config folder")
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
|
|
|
HMenuItem {
|
|
|
|
icon.name: "reload-config-files"
|
|
|
|
text: qsTr("Reload config & theme")
|
|
|
|
onTriggered: mainUI.reloadSettings()
|
|
|
|
}
|
|
|
|
|
|
|
|
HMenuItem {
|
|
|
|
icon.name: "debug"
|
|
|
|
text: qsTr("Developer console")
|
|
|
|
onTriggered: mainUI.debugConsole.toggle()
|
|
|
|
}
|
|
|
|
}
|
2020-05-13 07:37:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
HButton {
|
|
|
|
backgroundColor: "transparent"
|
|
|
|
|
|
|
|
text: qsTr("%1 %2")
|
|
|
|
.arg(Qt.application.displayName).arg(Qt.application.version)
|
2020-05-13 08:24:53 -04:00
|
|
|
label.color: theme.mainPane.topBar.nameVersionLabel
|
2020-05-13 07:37:39 -04:00
|
|
|
toolTip.text: qsTr("Open project repository")
|
|
|
|
|
|
|
|
onClicked:
|
|
|
|
Qt.openUrlExternally("https://github.com/mirukana/mirage")
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
|
|
|
|
|
|
|
HButton {
|
|
|
|
backgroundColor: "transparent"
|
|
|
|
|
2020-09-17 18:16:54 -04:00
|
|
|
icon.name:
|
|
|
|
window.notificationLevel === Window.NotificationLevel.All ?
|
|
|
|
"notifications-all" :
|
|
|
|
|
|
|
|
window.notificationLevel === Window.NotificationLevel.None ?
|
|
|
|
"notifications-none" :
|
|
|
|
|
|
|
|
"notifications-mentions-keywords"
|
|
|
|
|
|
|
|
icon.color:
|
|
|
|
window.notificationLevel === Window.NotificationLevel.All ?
|
|
|
|
theme.icons.colorize :
|
|
|
|
|
|
|
|
window.notificationLevel === Window.NotificationLevel.None ?
|
|
|
|
theme.colors.negativeBackground :
|
|
|
|
|
|
|
|
theme.colors.middleBackground
|
|
|
|
|
|
|
|
toolTip.text: qsTr("Control global notifications")
|
|
|
|
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 {
|
|
|
|
icon.name: "notifications-all"
|
|
|
|
text: qsTr("Normal notifications")
|
|
|
|
onTriggered:
|
|
|
|
window.notificationLevel =
|
|
|
|
Window.NotificationLevel.All
|
|
|
|
}
|
|
|
|
|
|
|
|
HMenuItem {
|
|
|
|
icon.name: "notifications-mentions-keywords"
|
|
|
|
icon.color: theme.colors.middleBackground
|
|
|
|
text: qsTr("Mentions & keywords")
|
|
|
|
onTriggered:
|
|
|
|
window.notificationLevel =
|
|
|
|
Window.NotificationLevel.MentionsKeywords
|
|
|
|
}
|
|
|
|
|
|
|
|
HMenuItem {
|
|
|
|
icon.name: "notifications-none"
|
|
|
|
icon.color: theme.colors.negativeBackground
|
|
|
|
text: qsTr("Nothing")
|
|
|
|
onTriggered:
|
|
|
|
window.notificationLevel =
|
|
|
|
Window.NotificationLevel.None
|
|
|
|
}
|
|
|
|
}
|
2020-05-13 07:37:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
HButton {
|
|
|
|
visible: Layout.preferredWidth > 0
|
|
|
|
backgroundColor: "transparent"
|
|
|
|
icon.name: "go-back-to-chat-from-main-pane"
|
|
|
|
toolTip.text: qsTr("Go back to room")
|
|
|
|
|
|
|
|
onClicked: mainPane.toggleFocus()
|
|
|
|
|
|
|
|
Layout.preferredWidth: mainPane.collapse ? implicitWidth : 0
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
Behavior on Layout.preferredWidth { HNumberAnimation {} }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|