Close inspector with Ctrl+W just like a tab

Fixes: https://bugs.launchpad.net/midori/+bug/797865
This commit is contained in:
Christian Dywan 2011-09-28 18:01:51 +02:00
parent ae56fbf818
commit 76a8f160f2

View file

@ -1821,6 +1821,18 @@ gtk_widget_button_press_event_cb (WebKitWebView* web_view,
return FALSE; return FALSE;
} }
static gboolean
midori_view_inspector_window_key_press_event_cb (GtkWidget* window,
GdkEventKey* event,
gpointer user_data)
{
/* Close window on Ctrl+W */
if (event->keyval == 'w' && (event->state & GDK_CONTROL_MASK))
gtk_widget_destroy (window);
return FALSE;
}
static gboolean static gboolean
gtk_widget_key_press_event_cb (WebKitWebView* web_view, gtk_widget_key_press_event_cb (WebKitWebView* web_view,
GdkEventKey* event, GdkEventKey* event,
@ -3422,6 +3434,9 @@ midori_view_web_inspector_construct_window (gpointer inspector,
gtk_container_add (GTK_CONTAINER (window), inspector_view); gtk_container_add (GTK_CONTAINER (window), inspector_view);
gtk_widget_show_all (window); gtk_widget_show_all (window);
g_signal_connect (window, "key-press-event",
G_CALLBACK (midori_view_inspector_window_key_press_event_cb), NULL);
/* FIXME: Update window title with URI */ /* FIXME: Update window title with URI */
} }