aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_summary
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/conversation_summary')
-rw-r--r--main/src/ui/conversation_summary/merged_message_item.vala16
-rw-r--r--main/src/ui/conversation_summary/view.vala17
2 files changed, 4 insertions, 29 deletions
diff --git a/main/src/ui/conversation_summary/merged_message_item.vala b/main/src/ui/conversation_summary/merged_message_item.vala
index 0270ef42..ec6b4f7b 100644
--- a/main/src/ui/conversation_summary/merged_message_item.vala
+++ b/main/src/ui/conversation_summary/merged_message_item.vala
@@ -42,20 +42,12 @@ public class MergedMessageItem : Grid {
name_label.label = Util.get_message_display_name(stream_interactor, message, conversation.account);
update_display_style();
- message_text_view.style_updated.connect(style_changed);
- }
-
- private void style_changed() {
- lock(message_text_view) {
- message_text_view.style_updated.disconnect(style_changed);
- update_display_style();
- message_text_view.style_updated.connect(style_changed);
- }
+ Util.force_base_background(message_text_view, "textview, text:not(:selected)");
+ message_text_view.style_updated.connect(update_display_style);
}
private void update_display_style() {
- TextView tmp = new TextView();
- RGBA bg = tmp.get_style_context().get_background_color(StateFlags.NORMAL);
+ RGBA bg = get_style_context().get_background_color(StateFlags.NORMAL);
bool dark_theme = (bg.red < 0.5 && bg.green < 0.5 && bg.blue < 0.5);
string display_name = Util.get_message_display_name(stream_interactor, messages[0], conversation.account);
@@ -64,8 +56,6 @@ public class MergedMessageItem : Grid {
LinkButton lnk = new LinkButton("http://example.com");
RGBA link_color = lnk.get_style_context().get_color(StateFlags.LINK);
link_tag.foreground_rgba = link_color;
-
- message_text_view.override_background_color(0, {0,0,0,0});
}
public void update() {
diff --git a/main/src/ui/conversation_summary/view.vala b/main/src/ui/conversation_summary/view.vala
index 87c553c5..2cf695b2 100644
--- a/main/src/ui/conversation_summary/view.vala
+++ b/main/src/ui/conversation_summary/view.vala
@@ -50,22 +50,7 @@ public class View : Box {
return true;
});
- update_background_color();
- this.style_updated.connect(style_changed);
- }
-
- private void update_background_color() {
- TextView tmp = new TextView();
- this.override_background_color(0, tmp.get_style_context().get_background_color(0));
- main.override_background_color(0, tmp.get_style_context().get_background_color(0));
- }
-
- private void style_changed() {
- lock (main) {
- this.style_updated.disconnect(style_changed);
- update_background_color();
- this.style_updated.connect(style_changed);
- }
+ Util.force_base_background(this);
}
public void initialize_for_conversation(Conversation? conversation) {