forked from enlightenment/efl
elm diskselector: Revert diskselector patch derived by Shinwoo Kim's diskselector patch.
That needs to be done in other way. Revert "From: Kim Shinwoo <kimcinoo.efl@gmail.com>" This reverts commit 9d6e461366a0eb208d75b0a1fb5c0c822b761c71. SVN revision: 75836
This commit is contained in:
parent
34b91f18d0
commit
c92e566fe5
|
@ -406,8 +406,3 @@
|
|||
* Track window states as a total count and be able to self-throttle
|
||||
or suspend rendering as a result.
|
||||
|
||||
2012-08-29 Shinwoo Kim (kimcinoo)
|
||||
|
||||
* Patch for selection of middle item in diskselector required adding
|
||||
API elm_diskselector_autoselect_set/get()
|
||||
|
||||
|
|
|
@ -186,17 +186,6 @@ group { name: "elm/diskselector/item/default";
|
|||
text.align: 0.8 0.5;
|
||||
}
|
||||
}
|
||||
part { name: "auto_select";
|
||||
type: RECT;
|
||||
mouse_events: 1;
|
||||
repeat_events: 1;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
}
|
||||
description {
|
||||
state: "disable" 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
programs {
|
||||
|
@ -234,29 +223,6 @@ group { name: "elm/diskselector/item/default";
|
|||
action: STATE_SET "icon_only" 0.0;
|
||||
target: "elm.swallow.icon";
|
||||
}
|
||||
program { name: "auto_select";
|
||||
signal: "elm,state,autoselect,default";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "auto_select";
|
||||
}
|
||||
program { name: "auto_select_disable";
|
||||
signal: "elm,state,autoselect,disable";
|
||||
source: "elm";
|
||||
action: STATE_SET "disable" 0.0;
|
||||
target: "auto_select";
|
||||
}
|
||||
program { name: "item_click";
|
||||
signal: "mouse,clicked,1";
|
||||
source: "auto_select";
|
||||
script {
|
||||
new st[31];
|
||||
new Float:vl;
|
||||
get_state(PART:"auto_select", st, 30, vl);
|
||||
if (!strcmp(st, "disable"))
|
||||
emit("elm,action,click", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -309,17 +275,13 @@ group { name: "elm/diskselector/item/datetime/default";
|
|||
text.align: 0.8 0.5;
|
||||
}
|
||||
}
|
||||
part { name: "auto_select";
|
||||
part { name: "over1";
|
||||
type: RECT;
|
||||
mouse_events: 1;
|
||||
repeat_events: 1;
|
||||
ignore_flags: ON_HOLD;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
description { state: "disable" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 0;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -400,28 +362,10 @@ group { name: "elm/diskselector/item/datetime/default";
|
|||
update_state();
|
||||
}
|
||||
}
|
||||
program { name: "auto_select";
|
||||
signal: "elm,state,autoselect,default";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "auto_select";
|
||||
}
|
||||
program { name: "auto_select_disable";
|
||||
signal: "elm,state,autoselect,disable";
|
||||
source: "elm";
|
||||
action: STATE_SET "disable" 0.0;
|
||||
target: "auto_select";
|
||||
}
|
||||
program { name: "field_click";
|
||||
signal: "mouse,clicked,1";
|
||||
source: "auto_select";
|
||||
script {
|
||||
new st[31];
|
||||
new Float:vl;
|
||||
get_state(PART:"auto_select", st, 30, vl);
|
||||
if (!strcmp(st, "disable"))
|
||||
emit("elm,action,click", "");
|
||||
}
|
||||
source: "over1";
|
||||
action: SIGNAL_EMIT "elm,action,click" "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -535,7 +535,6 @@ _item_click_cb(void *data,
|
|||
}
|
||||
|
||||
if (it->func) it->func((void *)it->base.data, WIDGET(it), it);
|
||||
evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, it);
|
||||
}
|
||||
|
||||
static char *
|
||||
|
@ -615,10 +614,6 @@ _item_new(Evas_Object *obj,
|
|||
_item_content_set_hook((Elm_Object_Item *)it, "icon", icon);
|
||||
}
|
||||
|
||||
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
||||
if (!sd->auto_select)
|
||||
edje_object_signal_emit(VIEW(it), "elm,state,autoselect,disable", "elm");
|
||||
|
||||
//XXX: ACCESS
|
||||
_elm_access_widget_item_register((Elm_Widget_Item *)it);
|
||||
|
||||
|
@ -878,8 +873,6 @@ _scroll_animate_stop_cb(Evas_Object *obj,
|
|||
|
||||
if (sd->idler) return;
|
||||
|
||||
if (!sd->auto_select) return;
|
||||
|
||||
if (!sd->round)
|
||||
list = sd->items;
|
||||
else
|
||||
|
@ -1095,7 +1088,6 @@ _elm_diskselector_smart_add(Evas_Object *obj)
|
|||
priv->init = EINA_FALSE;
|
||||
priv->len_side = 3;
|
||||
priv->display_item_num_by_api = EINA_FALSE;
|
||||
priv->auto_select = EINA_TRUE;
|
||||
|
||||
_elm_diskselector_smart_theme(obj);
|
||||
priv->s_iface->policy_set
|
||||
|
@ -1655,39 +1647,3 @@ elm_diskselector_display_item_num_get(const Evas_Object *obj)
|
|||
|
||||
return sd->display_item_num;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_diskselector_autoselect_set(Evas_Object *obj, Eina_Bool enable)
|
||||
{
|
||||
Elm_Diskselector_Item *it;
|
||||
Eina_List *l, *list;
|
||||
|
||||
ELM_DISKSELECTOR_CHECK(obj);
|
||||
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
||||
|
||||
enable = !!enable;
|
||||
if (sd->auto_select == enable) return;
|
||||
sd->auto_select = enable;
|
||||
|
||||
if (!sd->round)
|
||||
list = sd->items;
|
||||
else
|
||||
list = sd->r_items;
|
||||
|
||||
EINA_LIST_FOREACH (list, l, it)
|
||||
{
|
||||
if (!sd->auto_select)
|
||||
edje_object_signal_emit(VIEW(it), "elm,state,autoselect,disable", "elm");
|
||||
else
|
||||
edje_object_signal_emit(VIEW(it), "elm,state,autoselect,default", "elm");
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_diskselector_autoselect_get(const Evas_Object *obj)
|
||||
{
|
||||
ELM_DISKSELECTOR_CHECK(obj) EINA_TRUE;
|
||||
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
||||
|
||||
return sd->auto_select;
|
||||
}
|
||||
|
|
|
@ -174,34 +174,6 @@ EAPI void elm_diskselector_display_item_num_set(Evas_Object *o
|
|||
*/
|
||||
EAPI int elm_diskselector_display_item_num_get(const Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* Set the auto select of the diskselector
|
||||
*
|
||||
* After scroll diskselector, an item which is right in the center of diskselector
|
||||
* is selected automatically. This is default behavior of diskselector.
|
||||
* If @p enable is @c EINA_FALSE, the automatic selection is disabled and
|
||||
* even though item is not right in the center user can select item by clicking.
|
||||
*
|
||||
* @param obj The diskselector object.
|
||||
* @param enable EINA_TRUE to enable auto select, EINA_FALSE to disable auto select.
|
||||
* default is EINA_TRUE.
|
||||
*
|
||||
* @ingroup Diskselector
|
||||
* @since 1.8
|
||||
*/
|
||||
EAPI void elm_diskselector_autoselect_set(Evas_Object *obj, Eina_Bool enable);
|
||||
|
||||
/**
|
||||
* Get the auto select of the diskselector object.
|
||||
*
|
||||
* @param obj The diskselector object.
|
||||
* @return The auto select set (EINA_TRUE by default)
|
||||
*
|
||||
* @ingroup Diskselector
|
||||
* @since 1.8
|
||||
*/
|
||||
EAPI Eina_Bool elm_diskselector_autoselect_get(const Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* Set bouncing behaviour when the scrolled content reaches an edge.
|
||||
*
|
||||
|
|
|
@ -151,7 +151,6 @@ struct _Elm_Diskselector_Smart_Data
|
|||
Eina_Bool init : 1;
|
||||
Eina_Bool round : 1;
|
||||
Eina_Bool display_item_num_by_api : 1;
|
||||
Eina_Bool auto_select : 1;
|
||||
};
|
||||
|
||||
struct _Elm_Diskselector_Item
|
||||
|
|
|
@ -185,9 +185,9 @@ _field_clicked_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
|
|||
evas_object_geometry_get(obj, &x, &y, &w, &h);
|
||||
evas_object_geometry_get(elm_widget_top_get(ctx_mod->mod_data.base), NULL, NULL, &width, NULL);
|
||||
evas_object_size_hint_min_set(ctx_mod->ctxpopup, width, -1);
|
||||
display_item_num = w + elm_config_finger_size_get();
|
||||
|
||||
elm_diskselector_autoselect_set(diskselector, EINA_FALSE);
|
||||
display_item_num = width / (w + elm_config_finger_size_get());
|
||||
// always display even number of items to avoid autoselection
|
||||
if (display_item_num % 2) display_item_num -= 1;
|
||||
if (display_item_num < DISKSELECTOR_MIN_ITEMS)
|
||||
display_item_num = DISKSELECTOR_MIN_ITEMS;
|
||||
elm_diskselector_display_item_num_set(diskselector, display_item_num);
|
||||
|
|
Loading…
Reference in New Issue