message dialog: Stop hardcoding title styles
Instead, use a new title-2 style class to let
themes influence title formatting. Note that
the theme style will be overridden if the
application uses markup for presentation,
such as <b> or <i>.
diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c
index e70c820..08bc981 100644
--- a/gtk/gtkmessagedialog.c
+++ b/gtk/gtkmessagedialog.c
@@ -336,37 +336,6 @@
}
static void
-setup_primary_label_font (GtkMessageDialog *dialog)
-{
- GtkMessageDialogPrivate *priv = dialog->priv;
-
- if (!priv->has_primary_markup)
- {
- PangoAttrList *attributes;
- PangoAttribute *attr;
-
- attributes = pango_attr_list_new ();
-
- attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
- pango_attr_list_insert (attributes, attr);
-
- if (priv->has_secondary_text)
- {
- attr = pango_attr_scale_new (PANGO_SCALE_LARGE);
- pango_attr_list_insert (attributes, attr);
- }
-
- gtk_label_set_attributes (GTK_LABEL (priv->label), attributes);
- pango_attr_list_unref (attributes);
- }
- else
- {
- /* unset the font settings */
- gtk_label_set_attributes (GTK_LABEL (priv->label), NULL);
- }
-}
-
-static void
setup_type (GtkMessageDialog *dialog,
GtkMessageType type)
{
@@ -492,7 +461,6 @@
gtk_label_set_use_markup (GTK_LABEL (priv->label), priv->has_primary_markup);
g_object_notify_by_pspec (object, pspec);
}
- setup_primary_label_font (dialog);
break;
case PROP_SECONDARY_TEXT:
{
@@ -513,7 +481,6 @@
priv->has_secondary_text = FALSE;
gtk_widget_hide (priv->secondary_label);
}
- setup_primary_label_font (dialog);
}
break;
case PROP_SECONDARY_USE_MARKUP:
@@ -838,8 +805,6 @@
priv->has_secondary_text = FALSE;
gtk_widget_hide (priv->secondary_label);
}
-
- setup_primary_label_font (message_dialog);
}
/**
@@ -900,8 +865,6 @@
priv->has_secondary_text = FALSE;
gtk_widget_hide (priv->secondary_label);
}
-
- setup_primary_label_font (message_dialog);
}
/**
diff --git a/gtk/ui/gtkmessagedialog.ui b/gtk/ui/gtkmessagedialog.ui
index bc3532f..bce48b2 100644
--- a/gtk/ui/gtkmessagedialog.ui
+++ b/gtk/ui/gtkmessagedialog.ui
@@ -34,6 +34,9 @@
<property name="valign">start</property>
<property name="wrap">1</property>
<property name="max-width-chars">60</property>
+ <style>
+ <class name="title-2"/>
+ </style>
</object>
<packing>
<property name="fill">0</property>