power: Scale row subtitles to 0.9

This matches what the Mouse & Touchpad panel do, and
fixes a small inconsistency with the panel.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/553
This commit is contained in:
Georges Basile Stavracas Neto 2019-06-10 16:26:21 -03:00
parent 9b41718e4b
commit be5d6bfba1

View file

@ -219,6 +219,7 @@ row_title_new (const gchar *title,
const gchar *subtitle, const gchar *subtitle,
GtkWidget **title_label) GtkWidget **title_label)
{ {
PangoAttrList *attributes;
GtkWidget *box, *label; GtkWidget *box, *label;
box = (GtkWidget *) g_object_new (GTK_TYPE_BOX, box = (GtkWidget *) g_object_new (GTK_TYPE_BOX,
@ -245,6 +246,9 @@ row_title_new (const gchar *title,
if (subtitle == NULL) if (subtitle == NULL)
return box; return box;
attributes = pango_attr_list_new ();
pango_attr_list_insert (attributes, pango_attr_scale_new (0.9));
label = (GtkWidget *) g_object_new (GTK_TYPE_LABEL, label = (GtkWidget *) g_object_new (GTK_TYPE_LABEL,
"ellipsize", PANGO_ELLIPSIZE_END, "ellipsize", PANGO_ELLIPSIZE_END,
"halign", GTK_ALIGN_START, "halign", GTK_ALIGN_START,
@ -253,11 +257,14 @@ row_title_new (const gchar *title,
"use-underline", TRUE, "use-underline", TRUE,
"visible", TRUE, "visible", TRUE,
"xalign", 0.0, "xalign", 0.0,
"attributes", attributes,
NULL); NULL);
gtk_style_context_add_class (gtk_widget_get_style_context (label), gtk_style_context_add_class (gtk_widget_get_style_context (label),
GTK_STYLE_CLASS_DIM_LABEL); GTK_STYLE_CLASS_DIM_LABEL);
gtk_container_add (GTK_CONTAINER (box), label); gtk_container_add (GTK_CONTAINER (box), label);
pango_attr_list_unref (attributes);
return box; return box;
} }