Merge branch 'mcatanzaro/#3509' into 'master'

message dialog: use title style only if there is secondary text

Closes #3509

See merge request GNOME/gtk!3015
This commit is contained in:
Matthias Clasen 2020-12-29 17:47:01 +00:00
commit 5fe433418d
2 changed files with 6 additions and 3 deletions

View File

@ -383,11 +383,13 @@ gtk_message_dialog_set_property (GObject *object,
if (txt)
{
priv->has_secondary_text = TRUE;
gtk_widget_add_css_class (priv->label, "title");
gtk_widget_show (priv->secondary_label);
}
else
{
priv->has_secondary_text = FALSE;
gtk_widget_remove_css_class (priv->label, "title");
gtk_widget_hide (priv->secondary_label);
}
}
@ -621,6 +623,7 @@ gtk_message_dialog_format_secondary_text (GtkMessageDialog *message_dialog,
if (message_format)
{
priv->has_secondary_text = TRUE;
gtk_widget_add_css_class (priv->label, "title");
va_start (args, message_format);
msg = g_strdup_vprintf (message_format, args);
@ -634,6 +637,7 @@ gtk_message_dialog_format_secondary_text (GtkMessageDialog *message_dialog,
else
{
priv->has_secondary_text = FALSE;
gtk_widget_remove_css_class (priv->label, "title");
gtk_widget_hide (priv->secondary_label);
}
}
@ -677,6 +681,7 @@ gtk_message_dialog_format_secondary_markup (GtkMessageDialog *message_dialog,
if (message_format)
{
priv->has_secondary_text = TRUE;
gtk_widget_add_css_class (priv->label, "title");
va_start (args, message_format);
msg = g_strdup_vprintf (message_format, args);
@ -690,6 +695,7 @@ gtk_message_dialog_format_secondary_markup (GtkMessageDialog *message_dialog,
else
{
priv->has_secondary_text = FALSE;
gtk_widget_remove_css_class (priv->label, "title");
gtk_widget_hide (priv->secondary_label);
}
}

View File

@ -28,9 +28,6 @@
<property name="valign">start</property>
<property name="wrap">1</property>
<property name="max-width-chars">60</property>
<style>
<class name="title"/>
</style>
</object>
</child>
<child>