From 85f4bddf99f92647e67e7b69c1e1902730f5ea8f Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 3 Jan 2022 23:00:27 +0100 Subject: Use opacity for "pending" and "edited" hints Getting the dim-label color doesn't work without actually rendering it --- main/src/ui/conversation_content_view/message_widget.vala | 6 ++---- main/src/ui/util/helper.vala | 7 ------- 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'main') diff --git a/main/src/ui/conversation_content_view/message_widget.vala b/main/src/ui/conversation_content_view/message_widget.vala index a2325797..2b5fd793 100644 --- a/main/src/ui/conversation_content_view/message_widget.vala +++ b/main/src/ui/conversation_content_view/message_widget.vala @@ -216,10 +216,8 @@ public class MessageItemWidget : SizeRequestBin { markup_text = @"" + markup_text + ""; } - string gray_color = Util.rgba_to_hex(Util.get_label_pango_class_color(label, "dim-label")); - if (message.edit_to != null) { - markup_text += " (%s)".printf(gray_color, _("edited")); + markup_text += " (%s)".printf(_("edited")); theme_dependent = true; } @@ -228,7 +226,7 @@ public class MessageItemWidget : SizeRequestBin { if (message.direction == Message.DIRECTION_SENT && (message.marked == Message.Marked.SENDING || message.marked == Message.Marked.UNSENT)) { // Append "pending..." iff message has not been sent yet if (message.time.compare(new DateTime.now_utc().add_seconds(-10)) < 0) { - markup_text += " %s".printf(gray_color, _("pending…")); + markup_text += " %s".printf(_("pending…")); theme_dependent = true; additional_info = AdditionalInfo.PENDING; } else { diff --git a/main/src/ui/util/helper.vala b/main/src/ui/util/helper.vala index ecfb777d..c1c32048 100644 --- a/main/src/ui/util/helper.vala +++ b/main/src/ui/util/helper.vala @@ -161,13 +161,6 @@ public static Gdk.RGBA get_label_pango_color(Label label, string css_color) { return color_rgba; } -public static Gdk.RGBA get_label_pango_class_color(Label label, string css_class) { - label.get_style_context().add_class(css_class); - Gdk.RGBA color_rgba = label.get_style_context().get_color(StateFlags.NORMAL); - label.get_style_context().remove_class(css_class); - return color_rgba; -} - public static string rgba_to_hex(Gdk.RGBA rgba) { return "#%02x%02x%02x%02x".printf( (uint)(Math.round(rgba.red*255)), -- cgit v1.2.3-70-g09d2