From 9ca9d9ed718faeff3c78501e77897d22fe897aac Mon Sep 17 00:00:00 2001 From: hermet Date: Thu, 8 Dec 2011 13:53:38 +0000 Subject: [PATCH] elemenatry/toolbar - removed BASE macro to disable the item. but use the elm_widget_item_disabled_get instead. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@66033 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/elm_toolbar.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index 6c4d854..2659140 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -4,10 +4,6 @@ #include "els_box.h" #include "els_icon.h" -/* FIXME: I couldn't find a macro for it, this should be fixed. - * Just doing this commit to fix the brokeness that was introduced. */ -#define BASE(it) (&(it)->base) - typedef struct _Widget_Data Widget_Data; typedef struct _Elm_Toolbar_Item Elm_Toolbar_Item; @@ -153,7 +149,7 @@ _item_select(Elm_Toolbar_Item *it) Eina_Bool sel; if (!wd) return; - if ((BASE(it)->disabled) || (it->separator)) return; + if (elm_widget_item_disabled_get(it) || (it->separator)) return; sel = it->selected; if (!wd->no_select) @@ -226,9 +222,9 @@ _item_disable(Elm_Toolbar_Item *it, Eina_Bool disabled) Widget_Data *wd = elm_widget_data_get(WIDGET(it)); if (!wd) return; - if (BASE(it)->disabled == disabled) return; - BASE(it)->disabled = !!disabled; - if (BASE(it)->disabled) + if (elm_widget_item_disabled_get(it) == disabled) return; + elm_object_item_disabled_set((Elm_Object_Item *) it, disabled); + if (disabled) { edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm"); elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm"); @@ -320,7 +316,7 @@ _theme_hook_item(Evas_Object *obj, Elm_Toolbar_Item *it, double scale, int icon_ edje_object_signal_emit(view, "elm,state,selected", "elm"); elm_widget_signal_emit(it->icon, "elm,state,selected", "elm"); } - if (BASE(it)->disabled) + if (elm_widget_item_disabled_get(it)) { edje_object_signal_emit(view, "elm,state,disabled", "elm"); elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm"); @@ -543,7 +539,8 @@ _resize_job(void *data) menu_it = elm_menu_item_add(menu, NULL, it->icon_str, it->label, _elm_toolbar_item_menu_cb, it); - elm_object_item_disabled_set(menu_it, BASE(it)->disabled); + elm_object_item_disabled_set(menu_it, + elm_widget_item_disabled_get(it)); if (it->o_menu) elm_menu_clone(it->o_menu, menu, menu_it); } @@ -735,7 +732,7 @@ _access_state_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Widget_ Elm_Toolbar_Item *it = (Elm_Toolbar_Item *)item; if (it->separator) return strdup(E_("Separator")); - else if (BASE(it)->disabled) + else if (elm_widget_item_disabled_get(it)) return strdup(E_("State: Disabled")); else if (it->selected) return strdup(E_("State: Selected")); @@ -1766,7 +1763,7 @@ elm_toolbar_item_state_set(Elm_Object_Item *it, Elm_Toolbar_Item_State *state) wd->icon_size, "elm,state,icon_set,backward"); } - if (BASE(item)->disabled) + if (elm_widget_item_disabled_get(item)) elm_widget_signal_emit(item->icon, "elm,state,disabled", "elm"); else elm_widget_signal_emit(item->icon, "elm,state,enabled", "elm"); -- 2.7.4