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/eggtoggletoolbutton.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/eggtoggletoolbutton.c')
-rw-r--r-- | lib/egg/eggtoggletoolbutton.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/egg/eggtoggletoolbutton.c b/lib/egg/eggtoggletoolbutton.c index b755275f2..75d511709 100644 --- a/lib/egg/eggtoggletoolbutton.c +++ b/lib/egg/eggtoggletoolbutton.c @@ -38,7 +38,6 @@ enum { static void egg_toggle_tool_button_init (EggToggleToolButton *button); static void egg_toggle_tool_button_class_init (EggToggleToolButtonClass *klass); -static void egg_toggle_tool_button_finalize (GObject *object); static gboolean egg_toggle_tool_button_create_menu_proxy (EggToolItem *button); @@ -90,7 +89,6 @@ egg_toggle_tool_button_class_init (EggToggleToolButtonClass *klass) toolitem_class = (EggToolItemClass *)klass; toolbutton_class = (EggToolButtonClass *)klass; - object_class->finalize = egg_toggle_tool_button_finalize; toolitem_class->create_menu_proxy = egg_toggle_tool_button_create_menu_proxy; toolbutton_class->button_type = GTK_TYPE_TOGGLE_BUTTON; @@ -111,18 +109,6 @@ egg_toggle_tool_button_init (EggToggleToolButton *button) G_CALLBACK (button_toggled), button, 0); } -static void -egg_toggle_tool_button_finalize (GObject *object) -{ - EggToggleToolButton *button = EGG_TOGGLE_TOOL_BUTTON (object); - - if (button->menu_item) - g_object_remove_weak_pointer (G_OBJECT (button->menu_item), - (gpointer *)&(button->menu_item)); - - (* G_OBJECT_CLASS (parent_class)->finalize) (object); -} - static gboolean egg_toggle_tool_button_create_menu_proxy (EggToolItem *item) { @@ -162,6 +148,18 @@ egg_toggle_tool_button_create_menu_proxy (EggToolItem *item) return TRUE; } +/* There are two activatable widgets, a toggle button and a menu item. + * + * If a widget is activated and the state of the tool button is the same as + * the new state of the activated widget, then the other widget was the one + * that was activated by the user and updated the tool button's state. + * + * If the state of the tool button is not the same as the new state of the + * activated widget, then the activation was activated by the user, and the + * widget needs to make sure the tool button is updated before the other + * widget is activated. This will make sure the other widget a tool button + * in a state that matches its own new state. + */ static void menu_item_activated (GtkWidget *menu_item, EggToggleToolButton *toggle_tool_button) |