Show dark unread counts for notifying conversations, light ones otherwise

This commit is contained in:
fiaxh 2020-07-06 21:33:48 +02:00
parent 86420fdef1
commit a21ddefbb9
3 changed files with 27 additions and 4 deletions

View file

@ -110,9 +110,6 @@
<attribute name="scale" value="0.6"/> <attribute name="scale" value="0.6"/>
<attribute name="weight" value="PANGO_WEIGHT_BOLD"/> <attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
</attributes> </attributes>
<style>
<class name="unread-count"/>
</style>
</object> </object>
</child> </child>
</object> </object>

View file

@ -42,7 +42,7 @@ window.dino-main .dino-conversation .message-box:hover {
background: alpha(@theme_fg_color, 0.04); 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); background-color: alpha(@theme_fg_color, 0.8);
color: @theme_base_color; color: @theme_base_color;
font-family: monospace; font-family: monospace;
@ -50,6 +50,24 @@ window.dino-main .unread-count {
padding: .2em .41em; 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 { window.dino-main .dino-sidebar > frame {
background: @insensitive_bg_color; background: @insensitive_bg_color;
border-left: 1px solid @borders; border-left: 1px solid @borders;

View file

@ -219,6 +219,14 @@ public class ConversationSelectorRow : ListBoxRow {
unread_count_label.label = num_unread.to_string(); unread_count_label.label = num_unread.to_string();
unread_count_label.visible = true; 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)); name_label.attributes.insert(attr_weight_new(Weight.BOLD));
time_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)); nick_label.attributes.insert(attr_weight_new(Weight.BOLD));