summaryrefslogtreecommitdiff
path: root/libview
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-10 02:18:04 +0100
committerinfirit <[email protected]>2014-12-10 02:18:04 +0100
commit0e54ba33b487090b5befeb55ea6a6526bf207e35 (patch)
tree611fdd5f9fe8a55fd84b62754229134b49f02d1d /libview
parent1a09942161a051ffda7a88083428dee076b813c4 (diff)
downloadatril-0e54ba33b487090b5befeb55ea6a6526bf207e35.tar.bz2
atril-0e54ba33b487090b5befeb55ea6a6526bf207e35.tar.xz
libview: Save contents of FormTextFields when they loss focus.
Taken from evince commit: c8104d3426a7bd7ce6570a87363e4edeea472fce From: José Aliste <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=624921
Diffstat (limited to 'libview')
-rw-r--r--libview/ev-view.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c
index ceb7494d..d35dcb6d 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -2184,6 +2184,16 @@ ev_view_form_field_text_changed (GtkWidget *widget,
}
}
+static gboolean
+ev_view_form_field_text_focus_out (GtkWidget *widget,
+ GdkEventFocus *event,
+ EvView *view)
+{
+ ev_view_form_field_text_save (view, widget);
+
+ return FALSE;
+}
+
static GtkWidget *
ev_view_form_field_text_create_widget (EvView *view,
EvFormField *field)
@@ -2209,6 +2219,9 @@ ev_view_form_field_text_create_widget (EvView *view,
g_free (txt);
}
+ g_signal_connect (text, "focus-out-event",
+ G_CALLBACK (ev_view_form_field_text_focus_out),
+ view);
g_signal_connect (text, "changed",
G_CALLBACK (ev_view_form_field_text_changed),
field);
@@ -2226,7 +2239,10 @@ ev_view_form_field_text_create_widget (EvView *view,
gtk_text_buffer_set_text (buffer, txt, -1);
g_free (txt);
}
-
+
+ g_signal_connect( buffer, "focus-out-event",
+ G_CALLBACK (ev_view_form_field_text_focus_out),
+ view);
g_signal_connect (buffer, "changed",
G_CALLBACK (ev_view_form_field_text_changed),
field);