[totem/wip/exalm/tnum] bacon-time-label: Use tabular figures
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/wip/exalm/tnum] bacon-time-label: Use tabular figures
- Date: Fri, 24 Jan 2020 18:54:02 +0000 (UTC)
commit 687f5a693038e52b81c4d19bfb3f6dff8cf811dc
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..14441daea 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]