aboutsummaryrefslogtreecommitdiffstats
path: root/lib/egg/eggtoolbutton.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-05-11 20:24:35 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-05-11 20:24:35 +0800
commit1ffbaefc6b9d99f76fb666215709b6ab4e83d547 (patch)
treebf6cbc16d0f0a87c19ebcbe507f490c222a90d90 /lib/egg/eggtoolbutton.c
parent3ab85f2df9c5f3201d984d7e6fbe65767f340143 (diff)
downloadgsoc2013-epiphany-1ffbaefc6b9d99f76fb666215709b6ab4e83d547.tar
gsoc2013-epiphany-1ffbaefc6b9d99f76fb666215709b6ab4e83d547.tar.gz
gsoc2013-epiphany-1ffbaefc6b9d99f76fb666215709b6ab4e83d547.tar.bz2
gsoc2013-epiphany-1ffbaefc6b9d99f76fb666215709b6ab4e83d547.tar.lz
gsoc2013-epiphany-1ffbaefc6b9d99f76fb666215709b6ab4e83d547.tar.xz
gsoc2013-epiphany-1ffbaefc6b9d99f76fb666215709b6ab4e83d547.tar.zst
gsoc2013-epiphany-1ffbaefc6b9d99f76fb666215709b6ab4e83d547.zip
Update
2003-05-11 Marco Pesenti Gritti <marco@it.gnome.org> * lib/egg/egg-action.c: * lib/egg/eggseparatortoolitem.c: * lib/egg/eggtoggletoolbutton.c: * lib/egg/eggtoolbar.c: * lib/egg/eggtoolbutton.c: * lib/egg/eggtoolitem.c: * lib/egg/eggtoolitem.h: Update * src/bookmarks/Makefile.am: * src/bookmarks/ephy-bookmarks.c: * src/bookmarks/ephy-bookmarks-export.c: * src/bookmarks/ephy-bookmarks-export.h: Export bookmarks in an rdf format (RSS was perfect, so I just used it instead of inventing a new one). This is useful to ensure compatibility in case of database formats changes. It will be used also as import format for ephy. Also I think it can be easily displayed, need to talk with Edd about the css url though. Thanks to Edd Dumbill for the help with this.
Diffstat (limited to 'lib/egg/eggtoolbutton.c')
-rw-r--r--lib/egg/eggtoolbutton.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/egg/eggtoolbutton.c b/lib/egg/eggtoolbutton.c
index 14a83f3b8..36408d3ad 100644
--- a/lib/egg/eggtoolbutton.c
+++ b/lib/egg/eggtoolbutton.c
@@ -35,6 +35,8 @@
# define _(s) (s)
#endif
+#define MENU_ID "egg-tool-button-menu-id"
+
enum {
CLICKED,
LAST_SIGNAL
@@ -66,7 +68,7 @@ static void egg_tool_button_get_property (GObject *object,
static void egg_tool_button_finalize (GObject *object);
static void egg_tool_button_parent_set (GtkWidget *widget, GtkWidget *parent);
-static GtkWidget *egg_tool_button_create_menu_proxy (EggToolItem *item);
+static gboolean egg_tool_button_create_menu_proxy (EggToolItem *item);
static void button_clicked (GtkWidget *widget,
EggToolButton *button);
@@ -248,6 +250,8 @@ egg_tool_button_construct_contents (EggToolItem *tool_item)
gchar *text = _egg_tool_button_get_label_text (button);
label = gtk_label_new (text);
g_free (text);
+
+ gtk_widget_show (label);
}
}
@@ -267,7 +271,7 @@ egg_tool_button_construct_contents (EggToolItem *tool_item)
GtkImageType storage_type = gtk_image_get_storage_type (image);
/* FIXME: this seems a bit dubious. We are changing a widget that the
- * user passed in. It's probably better to create a new image instead.
+ * user passed in. It's probably better to create a new image instead.
*/
if (storage_type == GTK_IMAGE_STOCK)
@@ -319,10 +323,6 @@ egg_tool_button_construct_contents (EggToolItem *tool_item)
break;
}
- if (label)
- gtk_widget_show (label);
- if (icon)
- gtk_widget_show (icon);
if (box)
gtk_widget_show (box);
@@ -409,18 +409,21 @@ egg_tool_button_finalize (GObject *object)
parent_class->finalize (object);
}
-static GtkWidget *
+static gboolean
egg_tool_button_create_menu_proxy (EggToolItem *item)
{
EggToolButton *button = EGG_TOOL_BUTTON (item);
GtkWidget *menu_item;
GtkWidget *menu_image = NULL;
gchar *label;
-
+
label = _egg_tool_button_get_label_text (button);
menu_item = gtk_image_menu_item_new_with_label (label);
g_free (label);
+ g_object_ref (menu_item);
+ gtk_object_sink (GTK_OBJECT (menu_item));
+
if (button->icon_set)
{
menu_image = gtk_image_new_from_icon_set (button->icon_set, GTK_ICON_SIZE_MENU);
@@ -456,7 +459,11 @@ egg_tool_button_create_menu_proxy (EggToolItem *item)
EGG_TOOL_BUTTON (button)->button,
G_CONNECT_SWAPPED);
- return menu_item;
+ egg_tool_item_set_proxy_menu_item (EGG_TOOL_ITEM (button), MENU_ID, menu_item);
+
+ g_object_unref (menu_item);
+
+ return TRUE;
}
static void