aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2009-10-21 16:40:06 +0800
committerJonny Lamb <jonnylamb@gnome.org>2009-10-21 16:40:06 +0800
commit1aacf68f38e8169d9753b1e1f25d2613437f7611 (patch)
tree53cc5570816bbe34f51fc7e3ec7c02bb4ee87182 /src
parent8e9aa89166cf774b6d7efe83db68ac2d6540e840 (diff)
downloadgsoc2013-empathy-1aacf68f38e8169d9753b1e1f25d2613437f7611.tar
gsoc2013-empathy-1aacf68f38e8169d9753b1e1f25d2613437f7611.tar.gz
gsoc2013-empathy-1aacf68f38e8169d9753b1e1f25d2613437f7611.tar.bz2
gsoc2013-empathy-1aacf68f38e8169d9753b1e1f25d2613437f7611.tar.lz
gsoc2013-empathy-1aacf68f38e8169d9753b1e1f25d2613437f7611.tar.xz
gsoc2013-empathy-1aacf68f38e8169d9753b1e1f25d2613437f7611.tar.zst
gsoc2013-empathy-1aacf68f38e8169d9753b1e1f25d2613437f7611.zip
Add Ctrl-w keybinding to close map window.
Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
Diffstat (limited to 'src')
-rw-r--r--src/empathy-map-view.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c
index 95fdabd44..26ceeee6a 100644
--- a/src/empathy-map-view.c
+++ b/src/empathy-map-view.c
@@ -23,6 +23,7 @@
#include <sys/stat.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
+#include <gdk/gdkkeysyms.h>
#include <champlain/champlain.h>
#include <champlain-gtk/champlain-gtk.h>
@@ -306,6 +307,21 @@ map_view_destroy_cb (GtkWidget *widget,
}
static gboolean
+map_view_key_press_cb (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data)
+{
+ if (event->state & GDK_CONTROL_MASK
+ && event->keyval == GDK_w)
+ {
+ gtk_widget_destroy (widget);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static gboolean
map_view_tick (EmpathyMapView *window)
{
GList *marker;
@@ -352,6 +368,7 @@ empathy_map_view_show (void)
empathy_builder_connect (gui, window,
"map_view", "destroy", map_view_destroy_cb,
+ "map_view", "key-press-event", map_view_key_press_cb,
"zoom_in", "clicked", map_view_zoom_in_cb,
"zoom_out", "clicked", map_view_zoom_out_cb,
"zoom_fit", "clicked", map_view_zoom_fit_cb,