gtk_widget_destroy (toplevel);
}
+static void
+midori_view_detach_inspector_cb (GtkWidget* view,
+ GtkWidget* inspector_view,
+ MidoriBrowser* browser)
+{
+ GtkWidget* scrolled = gtk_widget_get_parent (GTK_WIDGET (inspector_view));
+ browser->inspector_view = gtk_viewport_new (NULL, NULL);
+ gtk_container_remove (GTK_CONTAINER (scrolled), GTK_WIDGET (inspector_view));
+ gtk_container_add (GTK_CONTAINER (scrolled), browser->inspector_view);
+}
+
static void
midori_browser_view_copy_history (GtkWidget* view_to,
GtkWidget* view_from,
midori_view_activate_action_cb, browser,
"signal::attach-inspector",
midori_view_attach_inspector_cb, browser,
+ "signal::detach-inspector",
+ midori_view_detach_inspector_cb, browser,
"signal::new-tab",
midori_view_new_tab_cb, browser,
"signal::new-window",
CONSOLE_MESSAGE,
CONTEXT_READY,
ATTACH_INSPECTOR,
+ DETACH_INSPECTOR,
NEW_TAB,
NEW_WINDOW,
NEW_VIEW,
G_TYPE_NONE, 1,
GTK_TYPE_WIDGET);
+ /**
+ * MidoriView::detach-inspector:
+ * @view: the object on which the signal is emitted
+ *
+ * Emitted when an open inspector that was previously
+ * attached to the window is now detached again.
+ *
+ * Since: 0.3.4
+ */
+ signals[DETACH_INSPECTOR] = g_signal_new (
+ "detach-inspector",
+ G_TYPE_FROM_CLASS (class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+ 0,
+ 0,
+ NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ GTK_TYPE_WIDGET);
+
signals[NEW_TAB] = g_signal_new (
"new-tab",
G_TYPE_FROM_CLASS (class),
return FALSE;
gtk_widget_hide (parent);
- gtk_container_remove (GTK_CONTAINER (parent), GTK_WIDGET (inspector_view));
+ g_signal_emit (view, signals[DETACH_INSPECTOR], 0, inspector_view);
midori_view_web_inspector_construct_window (inspector,
WEBKIT_WEB_VIEW (view->web_view), GTK_WIDGET (inspector_view), view);
return TRUE;