aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-tab.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-09-24 20:06:06 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-09-24 20:06:06 +0800
commit3844f2dc783a6e505e7f114bc1a747e5c040021c (patch)
treeda57bb88871a1ce0e5ec47311522507647d61556 /src/ephy-tab.c
parent330bb03126170f0be6527c71f44654aeefd46514 (diff)
downloadgsoc2013-epiphany-3844f2dc783a6e505e7f114bc1a747e5c040021c.tar
gsoc2013-epiphany-3844f2dc783a6e505e7f114bc1a747e5c040021c.tar.gz
gsoc2013-epiphany-3844f2dc783a6e505e7f114bc1a747e5c040021c.tar.bz2
gsoc2013-epiphany-3844f2dc783a6e505e7f114bc1a747e5c040021c.tar.lz
gsoc2013-epiphany-3844f2dc783a6e505e7f114bc1a747e5c040021c.tar.xz
gsoc2013-epiphany-3844f2dc783a6e505e7f114bc1a747e5c040021c.tar.zst
gsoc2013-epiphany-3844f2dc783a6e505e7f114bc1a747e5c040021c.zip
Dave Bordoley <bordoley@msu.edu>
2003-09-24 Marco Pesenti Gritti <marco@gnome.org> Dave Bordoley <bordoley@msu.edu> * src/ephy-tab.c: (ephy_tab_action_activate_cb), (ephy_tab_init): * src/ephy-tabs-menu.c: (tab_added_cb), (tab_removed_cb), (ephy_tabs_menu_set_window), (ephy_tabs_menu_set_property), (ephy_tabs_menu_class_init), (ephy_tabs_menu_init), (ephy_tabs_menu_clean), (ephy_tabs_menu_update): * src/ephy-window.c: (ephy_window_set_active_tab), (tab_added_cb), (tab_removed_cb), (tabs_reordered_cb): Use radio buttons for tabs menu. Do not recreate the action group every time but keep it synced. * src/ephy-notebook.c: (ephy_notebook_insert_page): Emit added signal before activating the page.
Diffstat (limited to 'src/ephy-tab.c')
-rw-r--r--src/ephy-tab.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index c5091239a..8e5b4605a 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -49,6 +49,7 @@
#include <gtk/gtkmain.h>
#include <gtk/gtkmenu.h>
#include <gtk/gtkuimanager.h>
+#include <gtk/gtkradioaction.h>
#include <string.h>
#define EPHY_TAB_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_TAB, EphyTabPrivate))
@@ -70,7 +71,7 @@ struct EphyTabPrivate
int total_requests;
int width;
int height;
- GtkAction *action;
+ GtkRadioAction *action;
float zoom;
EmbedSecurityLevel security_level;
TabNavigationFlags nav_flags;
@@ -230,7 +231,11 @@ ephy_tab_action_activate_cb (GtkAction *action, EphyTab *tab)
{
g_return_if_fail (EPHY_IS_TAB (tab));
- ephy_window_jump_to_tab (tab->priv->window, tab);
+ if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) &&
+ ephy_window_get_active_tab (tab->priv->window) != tab)
+ {
+ ephy_window_jump_to_tab (tab->priv->window, tab);
+ }
}
static void
@@ -1005,10 +1010,11 @@ ephy_tab_init (EphyTab *tab)
id = g_strdup_printf ("Tab%lu", tab_id++);
- tab->priv->action = g_object_new (GTK_TYPE_ACTION,
+ tab->priv->action = g_object_new (GTK_TYPE_RADIO_ACTION,
"name", id,
"label", _("Blank page"),
NULL);
+
g_free (id);
g_signal_connect (tab->priv->action, "activate",
G_CALLBACK (ephy_tab_action_activate_cb), tab);