diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-07-02 02:28:05 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-07-02 02:28:05 +0800 |
commit | c621f76b4e81a30f6d6db5eb16bf2c75d0980468 (patch) | |
tree | d2b3d20a5b3482fc27b0faa3fdfcf2624d9ab93a /lib/egg/eggtoolbutton.c | |
parent | 0ab1c928c782530b2d5ab0ad81cb46e5aaed539d (diff) | |
download | gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.tar gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.tar.gz gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.tar.bz2 gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.tar.lz gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.tar.xz gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.tar.zst gsoc2013-epiphany-c621f76b4e81a30f6d6db5eb16bf2c75d0980468.zip |
Make the location entry an EggToolItem, and provide a custom tooptip
2003-07-01 Christian Persch <chpe@cvs.gnome.org>
* lib/widgets/ephy-location-entry.h:
* lib/widgets/ephy-location-entry.c: (ephy_location_entry_set_tooltip),
(ephy_location_entry_construct_contents),
(ephy_location_entry_class_init), (ephy_location_entry_init),
(ephy_location_entry_finalize):
Make the location entry an EggToolItem, and provide a custom
tooptip setter. Fix mem leak.
* src/ephy-location-action.c: (create_tool_item),
(ephy_location_action_class_init), (connect_proxy):
Use the location entry EggToolItem instead of constructing it
explicitly.
* src/toolbar.c: (toolbar_setup_action):
Set tooltip for location entry.
* lib/egg/egg-action.c: (connect_proxy), (disconnect_proxy):
Connect the tooltip sync'er on any EggToolItem, not just EggTollButton:s.
Disconnect the tooltip sync func on disconnect, too.
Diffstat (limited to 'lib/egg/eggtoolbutton.c')
-rw-r--r-- | lib/egg/eggtoolbutton.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/lib/egg/eggtoolbutton.c b/lib/egg/eggtoolbutton.c index 88b70e632..6f827e576 100644 --- a/lib/egg/eggtoolbutton.c +++ b/lib/egg/eggtoolbutton.c @@ -211,8 +211,15 @@ egg_tool_button_size_request (GtkWidget *widget, { GtkWidget *child = GTK_BIN (widget)->child; - if (child) - gtk_widget_size_request (child, requisition); + if (child && GTK_WIDGET_VISIBLE (child)) + { + gtk_widget_size_request (child, requisition); + } + else + { + requisition->width = 0; + requisition->height = 0; + } requisition->width += GTK_CONTAINER (widget)->border_width * 2; requisition->height += GTK_CONTAINER (widget)->border_width * 2; @@ -617,19 +624,19 @@ void egg_tool_button_set_label (EggToolButton *button, const gchar *label) { + gchar *old_label; + g_return_if_fail (EGG_IS_TOOL_BUTTON (button)); - if (label != button->label_text) - { - if (button->label_text) - g_free (button->label_text); - - button->label_text = g_strdup (label); + old_label = button->label_text; - egg_tool_button_construct_contents (EGG_TOOL_ITEM (button)); + button->label_text = g_strdup (label); + egg_tool_button_construct_contents (EGG_TOOL_ITEM (button)); - g_object_notify (G_OBJECT (button), "label"); - } + g_object_notify (G_OBJECT (button), "label"); + + if (old_label) + g_free (old_label); } G_CONST_RETURN gchar * @@ -670,19 +677,18 @@ void egg_tool_button_set_stock_id (EggToolButton *button, const gchar *stock_id) { + gchar *old_stock_id; + g_return_if_fail (EGG_IS_TOOL_BUTTON (button)); - if (button->stock_id != stock_id) - { - if (button->stock_id) - g_free (button->stock_id); + old_stock_id = button->stock_id; - button->stock_id = g_strdup (stock_id); - - egg_tool_button_construct_contents (EGG_TOOL_ITEM (button)); + button->stock_id = g_strdup (stock_id); + egg_tool_button_construct_contents (EGG_TOOL_ITEM (button)); + + g_object_notify (G_OBJECT (button), "stock_id"); - g_object_notify (G_OBJECT (button), "stock_id"); - } + g_free (old_stock_id); } G_CONST_RETURN gchar * |