[totem/wip/exalm/tnum: 20/20] bacon-time-label: Use tabular figures
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/wip/exalm/tnum: 20/20] bacon-time-label: Use tabular figures
- Date: Thu, 27 Feb 2020 09:55:26 +0000 (UTC)
commit f1903e97a577ef45e25d914968d5dce64094c234
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]