From 34f98b48d130893f33fcef1184c74cb19e5aeb0a Mon Sep 17 00:00:00 2001 From: miruka Date: Tue, 28 Apr 2020 16:18:18 -0400 Subject: [PATCH] Add "every room" button --- src/backend/user_files.py | 7 ++++--- src/gui/MainPane/AccountsBar.qml | 27 +++++++++++++++++++++------ src/icons/thin/every-room.svg | 3 +++ src/themes/Midnight.qpl | 3 ++- 4 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 src/icons/thin/every-room.svg diff --git a/src/backend/user_files.py b/src/backend/user_files.py index a90ea041..d0d5d810 100644 --- a/src/backend/user_files.py +++ b/src/backend/user_files.py @@ -260,11 +260,12 @@ class UISettings(JSONDataFile): "previousTab": ["Alt+Shift+Left", "Alt+Shift+H"], "nextTab": ["Alt+Shift+Right", "Alt+Shift+L"], + "showEveryRoom": ["Alt+E"], + "addNewAccount": ["Alt+Shift+A"], + "accountSettings": ["Alt+A"], + "addNewChat": ["Alt+C"], "toggleFocusMainPane": ["Alt+F"], "clearRoomFilter": ["Alt+Shift+F"], - "accountSettings": ["Alt+A"], - "addNewAccount": ["Alt+Shift+A"], - "addNewChat": ["Alt+C"], "goToLastPage": ["Ctrl+Tab"], "goToPreviousAccount": ["Alt+Shift+N"], diff --git a/src/gui/MainPane/AccountsBar.qml b/src/gui/MainPane/AccountsBar.qml index 9930783e..a2317346 100644 --- a/src/gui/MainPane/AccountsBar.qml +++ b/src/gui/MainPane/AccountsBar.qml @@ -12,14 +12,18 @@ HColumnLayout { HButton { - id: settingsButton - backgroundColor: theme.accountsBar.settingsButtonBackground - icon.name: "settings" - toolTip.text: qsTr("Open config folder") - - onClicked: py.callCoro("get_config_dir", [], Qt.openUrlExternally) + id: everyRoomButton + icon.name: "every-room" + toolTip.text: qsTr("Every room") + backgroundColor: theme.accountsBar.everyRoomButtonBackground + // onClicked: pageLoader.showPage("AddAccount/AddAccount") Layout.preferredHeight: theme.baseElementsHeight + + HShortcut { + sequences: window.settings.keys.showEveryRoom + onActivated: everyRoomButton.clicked() + } } HListView { @@ -107,4 +111,15 @@ HColumnLayout { onActivated: addAccountButton.clicked() } } + + HButton { + id: settingsButton + backgroundColor: theme.accountsBar.settingsButtonBackground + icon.name: "settings" + toolTip.text: qsTr("Open config folder") + + onClicked: py.callCoro("get_config_dir", [], Qt.openUrlExternally) + + Layout.preferredHeight: theme.baseElementsHeight + } } diff --git a/src/icons/thin/every-room.svg b/src/icons/thin/every-room.svg new file mode 100644 index 00000000..d3162dae --- /dev/null +++ b/src/icons/thin/every-room.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/themes/Midnight.qpl b/src/themes/Midnight.qpl index 5e5c42f8..5bf871db 100644 --- a/src/themes/Midnight.qpl +++ b/src/themes/Midnight.qpl @@ -275,8 +275,9 @@ ui: accountsBar: - color settingsButtonBackground: colors.strongerBackground + color everyRoomButtonBackground: colors.strongerBackground color addAccountButtonBackground: colors.strongerBackground + color settingsButtonBackground: colors.strongerBackground accountList: color background: colors.strongerBackground