summaryrefslogtreecommitdiff
path: root/font-viewer
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2017-01-08 18:42:39 +0100
committerraveit65 <[email protected]>2017-02-17 12:28:22 +0100
commit137cb363afbcbd0b9b3cf337db99fedb043a141e (patch)
tree74cf35a608092c3d1b2700b815bf90dd2f50fd63 /font-viewer
parent9ee57014854f8290888f2c479d02cdcd67a124a6 (diff)
downloadmate-control-center-137cb363afbcbd0b9b3cf337db99fedb043a141e.tar.bz2
mate-control-center-137cb363afbcbd0b9b3cf337db99fedb043a141e.tar.xz
Fontviewer: refresh Install button appearance when model changes
So that we can e.g. change it to "Installed" when the font is copied over to ~/.fonts. taken from: https://git.gnome.org/browse/gnome-font-viewer/commit/?id=94dbcc0
Diffstat (limited to 'font-viewer')
-rw-r--r--font-viewer/font-view.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/font-viewer/font-view.c b/font-viewer/font-view.c
index f789bf2e..0b427a1d 100644
--- a/font-viewer/font-view.c
+++ b/font-viewer/font-view.c
@@ -288,6 +288,16 @@ font_install_finished_cb (GObject *source_object,
}
static void
+font_model_config_changed_cb (FontViewModel *model,
+ gpointer user_data)
+{
+ FontViewApplication *self = user_data;
+
+ if (self->font_file != NULL)
+ install_button_refresh_appearance (self, NULL);
+}
+
+static void
install_button_clicked_cb (GtkButton *button,
gpointer user_data)
{
@@ -612,6 +622,8 @@ font_view_application_startup (GApplication *application)
g_object_unref (menu);
self->model = font_view_model_new ();
+ g_signal_connect (self->model, "config-changed",
+ G_CALLBACK (font_model_config_changed_cb), self);
self->main_window = window = gtk_application_window_new (GTK_APPLICATION (application));
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);