[totem/wip/exalm/tnum] bacon-time-label: Use tabular figures



commit 9a5e32b156daaaebf65f546896b31378e459e62b
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Jan 24 23:53:08 2020 +0500

    bacon-time-label: Use tabular figures
    
    Prevent seekbar from jumping every second by forcing monospace digits if
    the font supports it.

 src/backend/bacon-time-label.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/backend/bacon-time-label.c b/src/backend/bacon-time-label.c
index 60b4bc441..a7d25205d 100644
--- a/src/backend/bacon-time-label.c
+++ b/src/backend/bacon-time-label.c
@@ -42,12 +42,19 @@ static void
 bacon_time_label_init (BaconTimeLabel *label)
 {
        char *time_string;
+       PangoAttrList *attrs;
+
        label->priv = bacon_time_label_get_instance_private (label);
 
        time_string = totem_time_to_string (0, FALSE, FALSE);
        gtk_label_set_text (GTK_LABEL (label), time_string);
        g_free (time_string);
 
+       attrs = pango_attr_list_new ();
+       pango_attr_list_insert (attrs, pango_attr_font_features_new ("tnum=1"));
+       gtk_label_set_attributes (GTK_LABEL (label), attrs);
+       pango_attr_list_unref (attrs);
+
        label->priv->time = 0;
        label->priv->length = -1;
        label->priv->remaining = FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]