From a21ddefbb987274991eb887e09d41274bd3e4a5e Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 6 Jul 2020 21:33:48 +0200 Subject: Show dark unread counts for notifying conversations, light ones otherwise --- main/data/conversation_row.ui | 3 --- main/data/theme.css | 20 +++++++++++++++++++- .../conversation_selector_row.vala | 8 ++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) (limited to 'main') diff --git a/main/data/conversation_row.ui b/main/data/conversation_row.ui index 8d257201..1dd75035 100644 --- a/main/data/conversation_row.ui +++ b/main/data/conversation_row.ui @@ -110,9 +110,6 @@ - diff --git a/main/data/theme.css b/main/data/theme.css index 09e282ec..6bacee30 100644 --- a/main/data/theme.css +++ b/main/data/theme.css @@ -42,7 +42,7 @@ window.dino-main .dino-conversation .message-box:hover { background: alpha(@theme_fg_color, 0.04); } -window.dino-main .unread-count { +window.dino-main .unread-count-notify { background-color: alpha(@theme_fg_color, 0.8); color: @theme_base_color; font-family: monospace; @@ -50,6 +50,24 @@ window.dino-main .unread-count { padding: .2em .41em; } +window.dino-main .unread-count-notify:backdrop { + background-color: alpha(@theme_unfocused_fg_color, 0.8); + color: @theme_unfocused_base_color; +} + +window.dino-main .unread-count { + background-color: alpha(@theme_fg_color, 0.1); + color: @theme_fg_color; + font-family: monospace; + border-radius: 999em; + padding: .2em .41em; +} + +window.dino-main .unread-count:backdrop { + background-color: alpha(@theme_unfocused_fg_color, 0.1); + color: @theme_unfocused_fg_color; +} + window.dino-main .dino-sidebar > frame { background: @insensitive_bg_color; border-left: 1px solid @borders; diff --git a/main/src/ui/conversation_selector/conversation_selector_row.vala b/main/src/ui/conversation_selector/conversation_selector_row.vala index 7c25ee8d..665e49ca 100644 --- a/main/src/ui/conversation_selector/conversation_selector_row.vala +++ b/main/src/ui/conversation_selector/conversation_selector_row.vala @@ -219,6 +219,14 @@ public class ConversationSelectorRow : ListBoxRow { unread_count_label.label = num_unread.to_string(); unread_count_label.visible = true; + if (conversation.get_notification_setting(stream_interactor) == Conversation.NotifySetting.ON) { + unread_count_label.get_style_context().add_class("unread-count-notify"); + unread_count_label.get_style_context().remove_class("unread-count"); + } else { + unread_count_label.get_style_context().add_class("unread-count"); + unread_count_label.get_style_context().remove_class("unread-count-notify"); + } + name_label.attributes.insert(attr_weight_new(Weight.BOLD)); time_label.attributes.insert(attr_weight_new(Weight.BOLD)); nick_label.attributes.insert(attr_weight_new(Weight.BOLD)); -- cgit v1.2.3-54-g00ecf