summaryrefslogtreecommitdiff
path: root/font-viewer/font-view.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2017-03-08 13:41:05 +0100
committerraveit65 <[email protected]>2017-03-08 16:08:00 +0100
commit35f3012334a832a83878bfee21ec4324d2662def (patch)
treedc35d08e329fb7bccf71e17ad9cfa40638a8d840 /font-viewer/font-view.c
parent440e7588459f39a56043bc85658aec5a9262a2e3 (diff)
downloadmate-control-center-35f3012334a832a83878bfee21ec4324d2662def.tar.bz2
mate-control-center-35f3012334a832a83878bfee21ec4324d2662def.tar.xz
font-viewer: sushi-font-widget: Add face_index argument
sushi_font_widget_new() now takes face index as the second argument. All callers changed. The face index of the widget can be accessed through the "face-index" property. Setting the "uri" property with g_object_set() no longer starts font loading, while it does when it is set through the constructor. This is to prevent the same font from being loaded twice, when both "uri" and "face-index" are set with g_object_set(). To start loading, you can explicitly call sushi_font_widget_load() after setting the properties. https://bugzilla.gnome.org/show_bug.cgi?id=752005 taken from: https://git.gnome.org/browse/gnome-font-viewer/commit/?id=3c48f73
Diffstat (limited to 'font-viewer/font-view.c')
-rw-r--r--font-viewer/font-view.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/font-viewer/font-view.c b/font-viewer/font-view.c
index c08eff1e..aab821b3 100644
--- a/font-viewer/font-view.c
+++ b/font-viewer/font-view.c
@@ -526,7 +526,7 @@ font_view_application_do_open (FontViewApplication *self,
GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 };
GtkWidget *w;
- self->font_widget = GTK_WIDGET (sushi_font_widget_new (uri));
+ self->font_widget = GTK_WIDGET (sushi_font_widget_new (uri, 0));
gtk_widget_override_color (self->font_widget, GTK_STATE_NORMAL, &black);
gtk_widget_override_background_color (self->font_widget, GTK_STATE_FLAG_NORMAL, &white);
@@ -542,7 +542,8 @@ font_view_application_do_open (FontViewApplication *self,
g_signal_connect (self->font_widget, "error",
G_CALLBACK (font_widget_error_cb), self);
} else {
- g_object_set (self->font_widget, "uri", uri, NULL);
+ g_object_set (self->font_widget, "uri", uri, "face-index", 0, NULL);
+ sushi_font_widget_load (SUSHI_FONT_WIDGET (self->font_widget));
}
g_free (uri);