From bbc462239c1812de229aab08589c6c59bb524b60 Mon Sep 17 00:00:00 2001 From: miruka Date: Tue, 28 Apr 2020 14:21:15 -0400 Subject: [PATCH] Improve accounts bar appearance --- TODO.md | 1 + src/gui/MainPane/AccountsBar.qml | 21 +++++++++++++++++++++ src/themes/Midnight.qpl | 5 +++++ 3 files changed, 27 insertions(+) diff --git a/TODO.md b/TODO.md index 1e1d670d..e2a551c0 100644 --- a/TODO.md +++ b/TODO.md @@ -8,6 +8,7 @@ - lag when switching accounts - message delegate too tall - unread counts on accounts +- fix compact mode - fix escape keybinds (filter rooms, message selection) - if last room event is a membership change, it won't be visible in timeline diff --git a/src/gui/MainPane/AccountsBar.qml b/src/gui/MainPane/AccountsBar.qml index bb09a39e..9930783e 100644 --- a/src/gui/MainPane/AccountsBar.qml +++ b/src/gui/MainPane/AccountsBar.qml @@ -24,13 +24,34 @@ HColumnLayout { HListView { id: accountList + clip: true model: ModelStore.get("accounts") currentIndex: accountView.currentIndex + highlight: Item { + + Rectangle { + anchors.fill: parent + color: theme.accountsBar.accountList.account.selectedBackground + opacity: theme.accountsBar.accountList.account + .selectedBackgroundOpacity + } + + Rectangle { + z: 100 + width: theme.accountsBar.accountList.account.selectedBorderSize + height: parent.height + color: theme.accountsBar.accountList.account.selectedBorder + } + } + delegate: HTileDelegate { id: tile width: accountList.width backgroundColor: theme.accountsBar.accountList.account.background + + topPadding: (accountList.width - avatar.width) / 4 + bottomPadding: topPadding leftPadding: 0 rightPadding: leftPadding diff --git a/src/themes/Midnight.qpl b/src/themes/Midnight.qpl index 01aa901b..5e5c42f8 100644 --- a/src/themes/Midnight.qpl +++ b/src/themes/Midnight.qpl @@ -285,6 +285,11 @@ accountsBar: color background: "transparent" int avatarRadius: controls.avatar.radius + color selectedBackground: colors.accentBackground + real selectedBackgroundOpacity: 0.3 + color selectedBorder: colors.strongAccentElement + int selectedBorderSize: 2 + accountView: account: