Use opacity for "pending" and "edited" hints

Getting the dim-label color doesn't work without actually rendering it
This commit is contained in:
fiaxh 2022-01-03 23:00:27 +01:00
parent 07a05db26e
commit 85f4bddf99
2 changed files with 2 additions and 11 deletions

View file

@ -216,10 +216,8 @@ public class MessageItemWidget : SizeRequestBin {
markup_text = @"<span size=\'$size_str\'>" + markup_text + "</span>"; markup_text = @"<span size=\'$size_str\'>" + markup_text + "</span>";
} }
string gray_color = Util.rgba_to_hex(Util.get_label_pango_class_color(label, "dim-label"));
if (message.edit_to != null) { if (message.edit_to != null) {
markup_text += " <span size='small' color='%s'>(%s)</span>".printf(gray_color, _("edited")); markup_text += " <span size='small' alpha='70%'>(%s)</span>".printf(_("edited"));
theme_dependent = true; 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)) { 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 // Append "pending..." iff message has not been sent yet
if (message.time.compare(new DateTime.now_utc().add_seconds(-10)) < 0) { if (message.time.compare(new DateTime.now_utc().add_seconds(-10)) < 0) {
markup_text += " <span size='small' color='%s'>%s</span>".printf(gray_color, _("pending…")); markup_text += " <span size='small' alpha='70%'>%s</span>".printf(_("pending…"));
theme_dependent = true; theme_dependent = true;
additional_info = AdditionalInfo.PENDING; additional_info = AdditionalInfo.PENDING;
} else { } else {

View file

@ -161,13 +161,6 @@ public static Gdk.RGBA get_label_pango_color(Label label, string css_color) {
return color_rgba; 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) { public static string rgba_to_hex(Gdk.RGBA rgba) {
return "#%02x%02x%02x%02x".printf( return "#%02x%02x%02x%02x".printf(
(uint)(Math.round(rgba.red*255)), (uint)(Math.round(rgba.red*255)),