tests: Stop using gtk_font_button_get_font_name

We can instead use the GtkFontChooser::font property.
This commit is contained in:
Matthias Clasen 2017-12-21 11:10:13 -05:00
parent 0e338d31a4
commit ed0600e8c0
2 changed files with 3 additions and 2 deletions

View File

@ -343,7 +343,8 @@ custom_widget_apply (GtkPrintOperation *operation,
PrintData *data) PrintData *data)
{ {
const char *selected_font; const char *selected_font;
selected_font = gtk_font_button_get_font_name (GTK_FONT_BUTTON (data->font_button)); selected_font = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (data->font_button));
g_free (data->font); g_free (data->font);
data->font = g_strdup (selected_font); data->font = g_strdup (selected_font);
} }

View File

@ -260,7 +260,7 @@ void calendar_select_font (GtkWidget *button,
gtk_style_context_add_provider (gtk_widget_get_style_context (calendar->window), GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); gtk_style_context_add_provider (gtk_widget_get_style_context (calendar->window), GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_set_data_full (G_OBJECT (calendar->window), "css-provider", provider, g_object_unref); g_object_set_data_full (G_OBJECT (calendar->window), "css-provider", provider, g_object_unref);
} }
font = gtk_font_button_get_font_name (GTK_FONT_BUTTON (button)); font = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (button));
data = g_strdup_printf ("GtkCalendar { font: %s; }", font); data = g_strdup_printf ("GtkCalendar { font: %s; }", font);
gtk_css_provider_load_from_data (provider, data, -1, NULL); gtk_css_provider_load_from_data (provider, data, -1, NULL);
g_free (data); g_free (data);