guint length_from;
gint i;
- copy_from = WEBKIT_WEB_VIEW (gtk_bin_get_child (GTK_BIN (view_from)));
+ copy_from = WEBKIT_WEB_VIEW (midori_view_get_web_view (MIDORI_VIEW (view_from)));
list_from = webkit_web_view_get_back_forward_list (copy_from);
- copy_to = WEBKIT_WEB_VIEW (gtk_bin_get_child (GTK_BIN (view_to)));
+ copy_to = WEBKIT_WEB_VIEW (midori_view_get_web_view (MIDORI_VIEW (view_to)));
list_to = webkit_web_view_get_back_forward_list (copy_to);
length_from = webkit_web_back_forward_list_get_back_length (list_from);
guint n;
GTK_WIDGET_SET_FLAGS (view, GTK_CAN_FOCUS);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view),
- GTK_SHADOW_ETCHED_IN);
tab_label = midori_view_get_proxy_tab_label (MIDORI_VIEW (view));
gtk_widget_hide (browser->find);
browser->find_typing = FALSE;
gtk_window_set_focus (GTK_WINDOW (browser),
- gtk_bin_get_child (GTK_BIN (view)) ?
- gtk_bin_get_child (GTK_BIN (view)) : view);
+ midori_view_get_web_view (MIDORI_VIEW (view)) ?
+ midori_view_get_web_view (MIDORI_VIEW (view)) : view);
}
static void
GtkWidget* web_view;
name = gtk_action_get_name (current);
- web_view = gtk_bin_get_child (GTK_BIN (view));
+ web_view = midori_view_get_web_view (MIDORI_VIEW (view));
if (!strcmp (name, "EncodingAutomatic"))
g_object_set (web_view, "custom-encoding", NULL, NULL);
else
source = midori_view_new (browser->net);
midori_view_set_settings (MIDORI_VIEW (source), browser->settings);
midori_view_set_uri (MIDORI_VIEW (source), "");
- web_view = gtk_bin_get_child (GTK_BIN (source));
+ web_view = midori_view_get_web_view (MIDORI_VIEW (source));
webkit_web_view_set_view_source_mode (WEBKIT_WEB_VIEW (web_view), TRUE);
webkit_web_view_load_uri (WEBKIT_WEB_VIEW (web_view), uri);
gtk_widget_show (source);
view = midori_browser_get_current_tab (browser);
if (!view)
return;
- web_view = WEBKIT_WEB_VIEW (gtk_bin_get_child (GTK_BIN (view)));
+ web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (MIDORI_VIEW (view)));
name = gtk_action_get_name (action);
if (g_str_equal (name, "ScrollLeft"))
else if (g_str_equal (name, "Back"))
{
GtkWidget* view;
+ GtkWidget* page;
WebKitWebBackForwardList* back_forward_list;
WebKitWebHistoryItem* back_item;
const gchar* back_uri;
gint n;
- view = gtk_bin_get_child (GTK_BIN (midori_browser_get_current_tab (browser)));
+ page = midori_browser_get_current_tab (browser);
+ view = midori_view_get_web_view (MIDORI_VIEW (page));
back_forward_list =
webkit_web_view_get_back_forward_list (WEBKIT_WEB_VIEW (view));
else if (g_str_equal (name, "Forward"))
{
GtkWidget *view;
+ GtkWidget *page;
WebKitWebBackForwardList *back_forward_list;
WebKitWebHistoryItem *forward_item;
const gchar *forward_uri;
gint n;
- view = gtk_bin_get_child (GTK_BIN (midori_browser_get_current_tab (browser)));
+ page = midori_browser_get_current_tab (browser);
+ view = midori_view_get_web_view (MIDORI_VIEW (page));
back_forward_list =
webkit_web_view_get_back_forward_list (WEBKIT_WEB_VIEW (view));
MidoriBrowser* browser)
{
GtkWidget* view = midori_browser_get_current_tab (browser);
- WebKitWebView* web_view = WEBKIT_WEB_VIEW (gtk_bin_get_child (GTK_BIN (view)));
+ WebKitWebView* web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (MIDORI_VIEW (view)));
WebKitWebInspector* inspector = webkit_web_view_get_inspector (web_view);
webkit_web_inspector_show (inspector);
}
MidoriBrowser* browser)
{
GtkWidget* view = midori_browser_get_current_tab (browser);
- GtkWidget* child = gtk_bin_get_child (GTK_BIN (view));
+ GtkWidget* child = midori_view_get_web_view (MIDORI_VIEW (view));
gtk_widget_grab_focus (child ? child : view);
}
view = gtk_notebook_get_nth_page (GTK_NOTEBOOK (browser->notebook), n);
if (view && midori_view_is_blank (MIDORI_VIEW (view)))
gtk_action_activate (_action_by_name (browser, "Location"));
- else if ((web_view = gtk_bin_get_child (GTK_BIN (view))))
+ else if ((web_view = midori_view_get_web_view (MIDORI_VIEW (view))))
gtk_widget_grab_focus (web_view);
else
gtk_widget_grab_focus (view);
gtk_notebook_set_current_page (GTK_NOTEBOOK (browser->notebook), n);
if (view && midori_view_is_blank (MIDORI_VIEW (view)))
gtk_action_activate (_action_by_name (browser, "Location"));
- else if ((web_view = gtk_bin_get_child (GTK_BIN (view))))
+ else if ((web_view = midori_view_get_web_view (MIDORI_VIEW (view))))
gtk_widget_grab_focus (web_view);
else
gtk_widget_grab_focus (view);
struct _MidoriView
{
- KatzeScrolled parent_instance;
+ GtkVBox parent_instance;
gchar* uri;
gboolean special;
KatzeNet* net;
GHashTable* memory;
+
+ GtkWidget* scrolled_window;
};
struct _MidoriViewClass
{
- KatzeScrolledClass parent_class;
+ GtkVBoxClass parent_class;
};
-G_DEFINE_TYPE (MidoriView, midori_view, KATZE_TYPE_SCROLLED);
+G_DEFINE_TYPE (MidoriView, midori_view, GTK_TYPE_VBOX);
GType
midori_load_status_get_type (void)
{
if (view->scrollh > 0)
{
- GtkAdjustment* adjustment = katze_object_get_object (view, "hadjustment");
+ GtkAdjustment* adjustment = katze_object_get_object (view->scrolled_window, "hadjustment");
gtk_adjustment_set_value (adjustment, view->scrollh);
g_object_unref (adjustment);
}
{
if (view->scrollv > 0)
{
- GtkAdjustment* adjustment = katze_object_get_object (view, "vadjustment");
+ GtkAdjustment* adjustment = katze_object_get_object (view->scrolled_window, "vadjustment");
gtk_adjustment_set_value (adjustment, view->scrollv);
g_object_unref (adjustment);
}
GParamSpec* pspec,
gpointer data)
{
- GtkAdjustment* hadjustment = katze_object_get_object (view, "hadjustment");
+ GtkAdjustment* hadjustment = katze_object_get_object (view->scrolled_window, "hadjustment");
g_signal_connect (hadjustment, "notify::value",
G_CALLBACK (midori_view_hadjustment_notify_value_cb), view);
g_object_unref (hadjustment);
GParamSpec* pspec,
gpointer data)
{
- GtkAdjustment* vadjustment = katze_object_get_object (view, "vadjustment");
+ GtkAdjustment* vadjustment = katze_object_get_object (view->scrolled_window, "vadjustment");
g_signal_connect (vadjustment, "notify::value",
G_CALLBACK (midori_view_vadjustment_notify_value_cb), view);
g_object_unref (vadjustment);
view->download_manager = NULL;
view->news_aggregator = NULL;
view->web_view = NULL;
-
/* Adjustments are not created initially, but overwritten later */
- g_object_set (view, "hadjustment", NULL, "vadjustment", NULL, NULL);
- g_signal_connect (view, "notify::hadjustment",
+ view->scrolled_window = katze_scrolled_new (NULL, NULL);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view->scrolled_window),
+ GTK_SHADOW_ETCHED_OUT);
+ gtk_container_add (GTK_CONTAINER (view), view->scrolled_window);
+
+ g_signal_connect (view->scrolled_window, "notify::hadjustment",
G_CALLBACK (midori_view_notify_hadjustment_cb), view);
- g_signal_connect (view, "notify::vadjustment",
+ g_signal_connect (view->scrolled_window, "notify::vadjustment",
G_CALLBACK (midori_view_notify_vadjustment_cb), view);
}
if (view->web_view)
g_object_set (view->web_view,
"full-content-zoom", zoom_text_and_images, NULL);
- g_object_set (view, "kinetic-scrolling", kinetic_scrolling, NULL);
+ g_object_set (view->scrolled_window, "kinetic-scrolling", kinetic_scrolling, NULL);
}
static void
"zoom-text-and-images"), NULL);
}
- gtk_widget_show (view->web_view);
- gtk_container_add (GTK_CONTAINER (view), view->web_view);
+ gtk_container_add (GTK_CONTAINER (view->scrolled_window), view->web_view);
+ gtk_widget_show_all (view->scrolled_window);
inspector = katze_object_get_object (view->web_view, "web-inspector");
g_object_connect (inspector,
GdkPixbuf* pixbuf;
g_return_val_if_fail (MIDORI_IS_VIEW (view), NULL);
- web_view = gtk_bin_get_child (GTK_BIN (view));
+ web_view = view->web_view;
g_return_val_if_fail (web_view->window, NULL);
x = web_view->allocation.x;