}
static void
-_midori_browser_update_interface (MidoriBrowser* browser)
+_midori_browser_update_interface (MidoriBrowser* browser,
+ MidoriView* view)
{
- GtkWidget* widget = midori_browser_get_current_tab (browser);
- MidoriView* view = MIDORI_VIEW (widget);
gboolean loading = midori_view_get_load_status (view) != MIDORI_LOAD_FINISHED;
gboolean can_reload = midori_view_can_reload (view);
GtkAction* action;
action = _action_by_name (browser, "Location");
midori_location_action_set_security_hint (
MIDORI_LOCATION_ACTION (action), midori_view_get_security (view));
- midori_browser_update_secondary_icon (browser, MIDORI_VIEW (view), action);
+ midori_browser_update_secondary_icon (browser, view, action);
}
static void
g_object_notify (G_OBJECT (browser), "uri");
}
- _midori_browser_update_interface (browser);
+ _midori_browser_update_interface (browser, view);
_midori_browser_set_statusbar_text (browser, NULL);
/* This is a hack to ensure that the address entry is focussed
/* FIXME: granite: should return GtkWidget* like GTK+ */
dialog = (GtkWidget*)granite_widgets_pop_over_new ();
granite_widgets_pop_over_move_to_widget (
- GRANITE_WIDGETS_POP_OVER (dialog), proxy);
+ GRANITE_WIDGETS_POP_OVER (dialog), proxy, TRUE);
}
else
#endif
else
new_pos = midori_browser_get_n_pages (browser) - 1;
#ifdef HAVE_GRANITE
- /* FIXME: There is no move/ set_tab_position function */
- granite_widgets_dynamic_notebook_remove_tab (
- GRANITE_WIDGETS_DYNAMIC_NOTEBOOK (browser->notebook),
- midori_view_get_tab (MIDORI_VIEW (widget)));
- granite_widgets_dynamic_notebook_insert_tab (
+ granite_widgets_dynamic_notebook_set_tab_position (
GRANITE_WIDGETS_DYNAMIC_NOTEBOOK (browser->notebook),
midori_view_get_tab (MIDORI_VIEW (widget)), new_pos);
#else
GtkAction* action;
const gchar* text;
- if (!(widget = midori_browser_get_current_tab (browser)))
+ if (!(widget = midori_browser_get_nth_tab (browser, page_num)))
return;
action = _action_by_name (browser, "Location");
const gchar* uri;
GtkAction* action;
- if (!(widget = midori_browser_get_current_tab (browser)))
+ if (!(widget = midori_browser_get_nth_tab (browser, page_num)))
return;
view = MIDORI_VIEW (widget);
g_object_notify (G_OBJECT (browser), "tab");
_midori_browser_set_statusbar_text (browser, NULL);
- _midori_browser_update_interface (browser);
+ _midori_browser_update_interface (browser, view);
_midori_browser_update_progress (browser, view);
}
}
static void
-midori_browser_notebook_tab_switched_cb (GtkWidget* notebook,
+midori_browser_notebook_tab_switched_cb (GraniteWidgetsDynamicNotebook* notebook,
GraniteWidgetsTab* old_tab,
GraniteWidgetsTab* new_tab,
MidoriBrowser* browser)
{
- midori_browser_notebook_switch_page_cb (notebook, NULL, 0, browser);
- midori_browser_notebook_switch_page_after_cb (notebook, NULL, 0, browser);
+ gint new_pos = granite_widgets_dynamic_notebook_get_tab_position (notebook, new_tab);
+ if (old_tab)
+ {
+ gint old_pos = granite_widgets_dynamic_notebook_get_tab_position (notebook, old_tab);
+ midori_browser_notebook_switch_page_cb (browser->notebook, NULL, old_pos, browser);
+ }
+ midori_browser_notebook_switch_page_after_cb (browser->notebook, NULL, new_pos, browser);
}
static void