2013-04-25 22:13:00 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2014-10-17 08:56:11 -07:00
|
|
|
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
|
|
|
|
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
|
2014-09-27 22:16:04 -07:00
|
|
|
#define ELM_WIDGET_ITEM_PROTECTED
|
2014-10-17 08:56:11 -07:00
|
|
|
|
2010-10-07 11:44:43 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_priv.h"
|
2012-07-31 15:05:00 -07:00
|
|
|
#include "elm_widget_diskselector.h"
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "elm_interface_scrollable.h"
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2011-04-06 21:54:55 -07:00
|
|
|
#define DISPLAY_ITEM_NUM_MIN 3
|
|
|
|
|
2014-06-03 03:35:28 -07:00
|
|
|
#define MY_CLASS ELM_DISKSELECTOR_CLASS
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2013-11-07 03:44:22 -08:00
|
|
|
#define MY_CLASS_NAME "Elm_Diskselector"
|
|
|
|
#define MY_CLASS_NAME_LEGACY "elm_diskselector"
|
2010-10-07 11:44:43 -07:00
|
|
|
|
|
|
|
static const char SIG_SELECTED[] = "selected";
|
2012-08-30 03:38:38 -07:00
|
|
|
static const char SIG_CLICKED[] = "clicked";
|
2012-03-14 05:29:22 -07:00
|
|
|
static const char SIG_SCROLL_ANIM_START[] = "scroll,anim,start";
|
|
|
|
static const char SIG_SCROLL_ANIM_STOP[] = "scroll,anim,stop";
|
|
|
|
static const char SIG_SCROLL_DRAG_START[] = "scroll,drag,start";
|
|
|
|
static const char SIG_SCROLL_DRAG_STOP[] = "scroll,drag,stop";
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
|
|
|
{SIG_SELECTED, ""},
|
2012-08-30 03:38:38 -07:00
|
|
|
{SIG_CLICKED, ""},
|
2012-07-17 15:09:07 -07:00
|
|
|
{SIG_SCROLL_ANIM_START, ""},
|
|
|
|
{SIG_SCROLL_ANIM_STOP, ""},
|
|
|
|
{SIG_SCROLL_DRAG_START, ""},
|
|
|
|
{SIG_SCROLL_DRAG_STOP, ""},
|
2014-01-23 03:07:20 -08:00
|
|
|
{SIG_WIDGET_LANG_CHANGED, ""}, /**< handled by elm_widget */
|
2014-02-07 21:05:06 -08:00
|
|
|
{SIG_WIDGET_ACCESS_CHANGED, ""}, /**< handled by elm_widget */
|
2014-01-23 00:24:19 -08:00
|
|
|
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
|
|
|
|
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
|
2012-07-17 15:09:07 -07:00
|
|
|
{NULL, NULL}
|
2010-10-07 11:44:43 -07:00
|
|
|
};
|
|
|
|
|
2014-03-31 19:10:25 -07:00
|
|
|
static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
|
|
|
|
|
|
|
|
static const Elm_Action key_actions[] = {
|
|
|
|
{"move", _key_action_move},
|
|
|
|
{NULL, NULL}
|
|
|
|
};
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_diskselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
|
2013-04-23 04:30:15 -07:00
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it;
|
2013-04-23 04:30:15 -07:00
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(sd->items, l, it)
|
2014-08-19 00:52:24 -07:00
|
|
|
eo_do(EO_OBJ(it), elm_wdg_item_translate());
|
2013-04-23 04:30:15 -07:00
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
return EINA_TRUE;
|
2013-04-23 04:30:15 -07:00
|
|
|
}
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
static void
|
2014-09-27 22:16:04 -07:00
|
|
|
_selected_item_indicate(Elm_Diskselector_Item_Data *item)
|
2012-07-17 15:09:07 -07:00
|
|
|
{
|
|
|
|
Eina_List *l;
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it;
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2013-09-02 19:38:45 -07:00
|
|
|
ELM_DISKSELECTOR_DATA_GET(WIDGET(item), sd);
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2013-09-02 19:38:45 -07:00
|
|
|
if (!item->label) return;
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2013-09-02 19:38:45 -07:00
|
|
|
EINA_LIST_FOREACH(sd->r_items, l, it)
|
2012-07-17 15:09:07 -07:00
|
|
|
{
|
2014-03-20 08:46:47 -07:00
|
|
|
if (it->label && !strcmp(it->label, item->label))
|
2013-09-02 19:38:45 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
|
2012-07-17 15:09:07 -07:00
|
|
|
else
|
2013-09-02 19:38:45 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,default", "elm");
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
static void
|
2014-09-27 22:16:04 -07:00
|
|
|
_item_select(Elm_Diskselector_Item_Data *it)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
if (!it) return;
|
|
|
|
|
|
|
|
ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd);
|
2014-11-25 04:54:52 -08:00
|
|
|
Elm_Object_Item *eo_it = EO_OBJ(it);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
sd->selected_item = it;
|
|
|
|
_selected_item_indicate(sd->selected_item);
|
|
|
|
|
2014-11-25 04:54:52 -08:00
|
|
|
if (it->func) it->func((void *)WIDGET_ITEM_DATA_GET(eo_it), WIDGET(it), eo_it);
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, eo_it);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2012-07-17 15:09:07 -07:00
|
|
|
_letters_count(const char *str)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
|
|
|
int pos = 0;
|
|
|
|
int code = 0, chnum;
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
for (chnum = 0;; chnum++)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
|
|
|
pos = evas_string_char_next_get(str, pos, &code);
|
|
|
|
if (code == 0) break;
|
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
return chnum;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2012-07-17 15:09:07 -07:00
|
|
|
_letters_check(const char *str,
|
|
|
|
int length)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
|
|
|
int pos = 0;
|
|
|
|
int code = 0, chnum;
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
for (chnum = 0;; chnum++)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
|
|
|
if (chnum == length) break;
|
|
|
|
pos = evas_string_char_next_get(str, pos, &code);
|
|
|
|
if (code == 0) break;
|
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
return pos;
|
|
|
|
}
|
2012-09-12 01:46:10 -07:00
|
|
|
static void
|
2014-09-27 22:16:04 -07:00
|
|
|
_item_signal_emit(Elm_Diskselector_Item_Data *it)
|
2012-09-12 01:46:10 -07:00
|
|
|
{
|
2013-09-02 19:38:45 -07:00
|
|
|
if ((it->icon) && (!it->label))
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,icon,only", "elm");
|
|
|
|
else if ((!it->icon) && (it->label))
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,text,only", "elm");
|
2012-09-12 01:46:10 -07:00
|
|
|
else
|
2013-09-02 19:38:45 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,text,icon", "elm");
|
2012-09-12 01:46:10 -07:00
|
|
|
}
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
|
|
|
static Eina_Bool
|
2013-01-24 04:22:02 -08:00
|
|
|
_string_check_idle_enterer_cb(void *data)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *obj = data;
|
|
|
|
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
|
|
|
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
int mid, steps, length, diff;
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
Eina_List *list, *l;
|
|
|
|
Evas_Coord ox, ow;
|
|
|
|
char buf[1024];
|
|
|
|
|
2015-01-30 01:47:09 -08:00
|
|
|
if (!sd)
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
evas_object_geometry_get(obj, &ox, NULL, &ow, NULL);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
if (ow <= 0)
|
2013-01-24 04:22:02 -08:00
|
|
|
{
|
|
|
|
sd->string_check_idle_enterer = NULL;
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
if (!sd->init)
|
2013-01-24 04:22:02 -08:00
|
|
|
{
|
|
|
|
sd->string_check_idle_enterer = NULL;
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
if (!sd->round)
|
|
|
|
list = sd->items;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
else
|
2012-07-17 15:09:07 -07:00
|
|
|
list = sd->r_items;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(list, l, it)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
|
|
|
Evas_Coord x, w;
|
|
|
|
int len;
|
2012-05-21 03:30:47 -07:00
|
|
|
|
|
|
|
if (it->icon && !it->label)
|
|
|
|
continue;
|
|
|
|
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
evas_object_geometry_get(VIEW(it), &x, NULL, &w, NULL);
|
|
|
|
/* item not visible */
|
|
|
|
if ((x + w <= ox) || (x >= ox + ow))
|
|
|
|
continue;
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
len = _letters_count(it->label);
|
|
|
|
// FIXME: len should be # of ut8f letters. ie count using utf8
|
|
|
|
// string walk, not stringshare len
|
|
|
|
//len = eina_stringshare_strlen(it->label);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
|
|
|
if (x <= ox + 5)
|
2012-07-17 15:09:07 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,left_side", "elm");
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
else if (x + w >= ox + ow - 5)
|
2012-07-17 15:09:07 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,right_side", "elm");
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
else
|
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
if ((sd->len_threshold) && (len > sd->len_threshold))
|
|
|
|
edje_object_signal_emit
|
|
|
|
(VIEW(it), "elm,state,center_small", "elm");
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
else
|
2012-07-17 15:09:07 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,center", "elm");
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
// if len is les that the limit len, skip anyway
|
2012-07-17 15:09:07 -07:00
|
|
|
if (len <= sd->len_side)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
continue;
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
steps = len - sd->len_side + 1;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
mid = x + w / 2;
|
|
|
|
if (mid <= ox + ow / 2)
|
|
|
|
diff = (ox + ow / 2) - mid;
|
|
|
|
else
|
|
|
|
diff = mid - (ox + ow / 2);
|
|
|
|
|
|
|
|
length = len - (int)(diff * steps / (ow / 3));
|
2012-07-17 15:09:07 -07:00
|
|
|
length = MAX(length, sd->len_side);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
// limit string len to "length" ut8f chars
|
2012-07-17 15:09:07 -07:00
|
|
|
length = _letters_check(it->label, length);
|
|
|
|
// cut it off at byte mark returned form _letters_check
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
strncpy(buf, it->label, length);
|
|
|
|
buf[length] = '\0';
|
2012-04-20 05:51:10 -07:00
|
|
|
edje_object_part_text_escaped_set(VIEW(it), "elm.text", buf);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
|
2013-01-24 04:22:02 -08:00
|
|
|
sd->string_check_idle_enterer = NULL;
|
|
|
|
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_string_check(void *data)
|
|
|
|
{
|
|
|
|
Evas_Object *obj = data;
|
|
|
|
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2014-01-21 16:55:58 -08:00
|
|
|
ELM_SAFE_FREE(sd->string_check_idle_enterer, ecore_idle_enterer_del);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2013-01-24 04:22:02 -08:00
|
|
|
// call string check idle enterer directly
|
|
|
|
_string_check_idle_enterer_cb(data);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_scroller_move(void *data)
|
|
|
|
{
|
|
|
|
Evas_Object *obj = data;
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *dit;
|
2012-07-17 15:09:07 -07:00
|
|
|
Eina_List *list, *l;
|
|
|
|
Evas_Coord y, w, h;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (!sd->round)
|
|
|
|
{
|
|
|
|
i = 0;
|
|
|
|
list = sd->items;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
i = 1;
|
|
|
|
list = sd->r_items;
|
|
|
|
}
|
|
|
|
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(list, l, dit)
|
2012-07-17 15:09:07 -07:00
|
|
|
{
|
|
|
|
if (sd->selected_item == dit)
|
|
|
|
break;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sd->round) i -= CEIL(sd->display_item_num);
|
|
|
|
|
|
|
|
if (!dit)
|
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
sd->selected_item = eina_list_nth(sd->items, 0);
|
2012-07-17 15:09:07 -07:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
evas_object_geometry_get(obj, NULL, &y, &w, &h);
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do(obj, elm_interface_scrollable_content_region_show(w / sd->display_item_num * i, y, w, h));
|
2012-07-17 15:09:07 -07:00
|
|
|
_item_select(dit);
|
|
|
|
|
|
|
|
sd->init = EINA_TRUE;
|
2012-11-25 22:32:53 -08:00
|
|
|
_string_check(obj);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
end:
|
2013-01-22 02:49:00 -08:00
|
|
|
sd->scroller_move_idle_enterer = NULL;
|
2012-07-17 15:09:07 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_resize_cb(void *data EINA_UNUSED,
|
|
|
|
Evas *e EINA_UNUSED,
|
2012-07-17 15:09:07 -07:00
|
|
|
Evas_Object *obj,
|
2014-01-06 06:30:02 -08:00
|
|
|
void *event_info EINA_UNUSED)
|
2012-07-17 15:09:07 -07:00
|
|
|
{
|
2013-11-28 02:24:26 -08:00
|
|
|
Evas_Coord w, h, vw = 0, vh = 0, mw = 0, mh = 0;
|
2012-07-17 15:09:07 -07:00
|
|
|
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
2013-10-05 01:14:08 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
if ((sd->minw == -1) && (sd->minh == -1))
|
|
|
|
elm_coords_finger_size_adjust(6, &sd->minw, 1, &sd->minh);
|
|
|
|
|
entry: wrong viewport value calculation issue fix
Summary:
Issue: As entire scroller edje co-ordinates was being taken instead of the actual viewport value,
if in scroller edje more parts are added apart from just "elm.swallow.content", then the viewport value
set will be wrong. hence the selection handlers will not hide when they have to hide.
solution: Instead of taking scroller edje's geometry, get the actual viewport values.
To get viewport x,y a new scrollable interface is also added.
signed-off by: Shilpa Singh <shilpa.singh@samsung.com>
@fix
Test Plan: Selection handlers have to hide correctly when the text is scrolled in a scrolled entry, if the scroller edc of entry has more parts added other than elm.swallow.content, then when we scroll the selection handlers are not hidden correctly.
Reviewers: jaehwan, woohyun, seoz, Hermet, raster
CC: govi, rajeshps, thiepha
Differential Revision: https://phab.enlightenment.org/D674
2014-04-20 20:31:49 -07:00
|
|
|
eo_do(obj, elm_interface_scrollable_content_viewport_geometry_get
|
|
|
|
(NULL, NULL, &vw, &vh));
|
2013-11-28 02:24:26 -08:00
|
|
|
if (sd->items)
|
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it = sd->items->data;
|
2013-11-28 02:24:26 -08:00
|
|
|
evas_object_size_hint_min_get(VIEW(it), &mw, &mh);
|
|
|
|
}
|
|
|
|
if (sd->minh < mh) sd->minh = mh;
|
2012-07-17 15:09:07 -07:00
|
|
|
edje_object_size_min_restricted_calc
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj, &sd->minw, &sd->minh, sd->minw,
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->minh);
|
|
|
|
|
|
|
|
evas_object_size_hint_min_set(obj, sd->minw, sd->minh);
|
|
|
|
evas_object_size_hint_max_set(obj, -1, -1);
|
|
|
|
|
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
|
|
|
if (sd->round)
|
|
|
|
evas_object_resize(sd->main_box, (w / sd->display_item_num)
|
|
|
|
* (sd->item_count + (CEIL(sd->display_item_num) * 2)),
|
|
|
|
h);
|
|
|
|
else
|
|
|
|
evas_object_resize(sd->main_box, (w / sd->display_item_num)
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
* (sd->item_count + eina_list_count(sd->left_blanks)
|
|
|
|
+ eina_list_count(sd->right_blanks)), h);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do(obj, elm_interface_scrollable_paging_set(0, 0, (int)(w / sd->display_item_num), 0));
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2013-01-22 02:49:00 -08:00
|
|
|
if (!sd->scroller_move_idle_enterer)
|
|
|
|
sd->scroller_move_idle_enterer = ecore_idle_enterer_before_add(_scroller_move, obj);
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-09-27 22:16:04 -07:00
|
|
|
_item_del(Elm_Diskselector_Item_Data *item)
|
2012-07-17 15:09:07 -07:00
|
|
|
{
|
|
|
|
if (!item) return;
|
|
|
|
|
2013-11-20 21:26:39 -08:00
|
|
|
ELM_DISKSELECTOR_DATA_GET(WIDGET(item), sd);
|
|
|
|
sd->item_count -= 1;
|
2012-07-17 15:09:07 -07:00
|
|
|
eina_stringshare_del(item->label);
|
2014-01-21 17:38:55 -08:00
|
|
|
evas_object_del(item->icon);
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_sizing_eval(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
_resize_cb(NULL, NULL, obj, NULL);
|
|
|
|
}
|
|
|
|
|
2014-09-17 06:44:05 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_diskselector_item_eo_base_destructor(Eo *eo_it, Elm_Diskselector_Item_Data *it)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *item2, *dit;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
Eina_List *l;
|
|
|
|
int i = 0;
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2013-09-02 19:38:45 -07:00
|
|
|
Evas_Object *obj = WIDGET(it);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2013-09-02 19:38:45 -07:00
|
|
|
elm_box_unpack(sd->main_box, VIEW(it));
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (sd->round)
|
2013-09-02 19:38:45 -07:00
|
|
|
sd->r_items = eina_list_remove(sd->r_items, it);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2013-09-02 19:38:45 -07:00
|
|
|
sd->items = eina_list_remove(sd->items, it);
|
2014-09-17 06:44:05 -07:00
|
|
|
sd->under_items = eina_list_remove(sd->under_items, it);
|
|
|
|
sd->over_items = eina_list_remove(sd->over_items, it);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2013-09-02 19:38:45 -07:00
|
|
|
if (sd->selected_item == it)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
2014-03-03 01:10:47 -08:00
|
|
|
if (sd->items)
|
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
sd->selected_item = eina_list_nth(sd->items, 0);
|
2014-03-03 01:10:47 -08:00
|
|
|
_selected_item_indicate(sd->selected_item);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
sd->selected_item = NULL;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
|
2013-09-02 19:38:45 -07:00
|
|
|
_item_del(it);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (sd->round)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
if (!sd->item_count)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
2014-09-17 06:44:05 -07:00
|
|
|
if (sd->first) evas_object_hide(sd->VIEW(first));
|
|
|
|
if (sd->second) evas_object_hide(sd->VIEW(second));
|
|
|
|
if (sd->last) evas_object_hide(sd->VIEW(last));
|
|
|
|
if (sd->s_last) evas_object_hide(sd->VIEW(s_last));
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(sd->under_items, l, item2)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
evas_object_hide(VIEW(item2));
|
|
|
|
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(sd->over_items, l, item2)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
evas_object_hide(VIEW(item2));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
dit = eina_list_nth(sd->items, 0);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
if (dit)
|
|
|
|
{
|
2014-09-17 06:44:05 -07:00
|
|
|
if (sd->first)
|
|
|
|
{
|
|
|
|
eina_stringshare_replace(&sd->first->label, dit->label);
|
|
|
|
edje_object_part_text_escaped_set
|
|
|
|
(sd->VIEW(first), "elm.text", sd->first->label);
|
|
|
|
}
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
dit = eina_list_nth(sd->items, 1);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
if (dit)
|
|
|
|
{
|
2014-09-17 06:44:05 -07:00
|
|
|
if (sd->second)
|
|
|
|
{
|
|
|
|
eina_stringshare_replace(&sd->second->label, dit->label);
|
|
|
|
edje_object_part_text_escaped_set
|
|
|
|
(sd->VIEW(second), "elm.text", sd->second->label);
|
|
|
|
}
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
// if more than 3 itmes should be displayed
|
2012-07-17 15:09:07 -07:00
|
|
|
for (i = 2; i < CEIL(sd->display_item_num); i++)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
dit = eina_list_nth(sd->items, i);
|
|
|
|
item2 = eina_list_nth(sd->over_items, i - 2);
|
2014-09-17 06:44:05 -07:00
|
|
|
if (!dit || !item2) continue;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
eina_stringshare_replace(&item2->label, dit->label);
|
2012-07-17 15:09:07 -07:00
|
|
|
edje_object_part_text_escaped_set
|
|
|
|
(VIEW(item2), "elm.text", item2->label);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
dit = eina_list_nth(sd->items, eina_list_count(sd->items) - 1);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
if (dit)
|
|
|
|
{
|
2014-09-17 06:44:05 -07:00
|
|
|
if (sd->last)
|
|
|
|
{
|
|
|
|
eina_stringshare_replace(&sd->last->label, dit->label);
|
|
|
|
edje_object_part_text_escaped_set
|
|
|
|
(sd->VIEW(last), "elm.text", sd->last->label);
|
|
|
|
}
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
dit = eina_list_nth(sd->items, eina_list_count(sd->items) - 2);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
if (dit)
|
|
|
|
{
|
2014-09-17 06:44:05 -07:00
|
|
|
if (sd->s_last)
|
|
|
|
{
|
|
|
|
eina_stringshare_replace(&sd->s_last->label, dit->label);
|
|
|
|
edje_object_part_text_escaped_set
|
|
|
|
(sd->VIEW(s_last), "elm.text", sd->s_last->label);
|
|
|
|
}
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
// if more than 3 itmes should be displayed
|
2012-07-17 15:09:07 -07:00
|
|
|
for (i = 3; i <= CEIL(sd->display_item_num); i++)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
dit = eina_list_nth(sd->items, sd->item_count - i);
|
|
|
|
item2 = eina_list_nth(sd->under_items, i - 3);
|
2014-09-17 06:44:05 -07:00
|
|
|
if (!dit || !item2) continue;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
eina_stringshare_replace(&item2->label, dit->label);
|
2012-07-17 15:09:07 -07:00
|
|
|
edje_object_part_text_escaped_set
|
|
|
|
(VIEW(item2), "elm.text", item2->label);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2015-01-06 18:16:38 -08:00
|
|
|
if (!sd->string_check_idle_enterer)
|
|
|
|
{
|
|
|
|
sd->string_check_idle_enterer =
|
|
|
|
ecore_idle_enterer_before_add(_string_check_idle_enterer_cb,
|
|
|
|
obj);
|
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
_sizing_eval(obj);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2014-09-17 06:44:05 -07:00
|
|
|
eo_do_super(eo_it, ELM_DISKSELECTOR_ITEM_CLASS, eo_destructor());
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_diskselector_item_elm_widget_item_part_text_set(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
|
2012-07-17 15:09:07 -07:00
|
|
|
const char *part,
|
|
|
|
const char *label)
|
|
|
|
{
|
2013-11-28 02:24:26 -08:00
|
|
|
Evas_Coord mw, mh;
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
if (part && strcmp(part, "default")) return;
|
|
|
|
|
2013-09-02 19:38:45 -07:00
|
|
|
eina_stringshare_replace(&it->label, label);
|
|
|
|
edje_object_part_text_escaped_set(VIEW(it), "elm.text", it->label);
|
|
|
|
_item_signal_emit(it);
|
2013-11-28 02:24:26 -08:00
|
|
|
edje_object_size_min_calc(VIEW(it), &mw, &mh);
|
|
|
|
evas_object_size_hint_min_set(VIEW(it), 0, mh);
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
EOLIAN static const char *
|
|
|
|
_elm_diskselector_item_elm_widget_item_part_text_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
|
2012-07-17 15:09:07 -07:00
|
|
|
const char *part)
|
|
|
|
{
|
|
|
|
if (part && strcmp(part, "default")) return NULL;
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
return it->label;
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-09-27 22:16:04 -07:00
|
|
|
_item_icon_set(Elm_Diskselector_Item_Data *it,
|
2012-07-17 15:09:07 -07:00
|
|
|
Evas_Object *icon)
|
|
|
|
{
|
|
|
|
if (it->icon == icon) return;
|
|
|
|
|
2014-01-21 17:38:55 -08:00
|
|
|
evas_object_del(it->icon);
|
2012-07-17 15:09:07 -07:00
|
|
|
it->icon = icon;
|
2012-09-12 01:46:10 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (VIEW(it))
|
|
|
|
{
|
|
|
|
evas_object_size_hint_min_set(it->icon, 24, 24);
|
|
|
|
evas_object_size_hint_max_set(it->icon, 40, 40);
|
|
|
|
edje_object_part_swallow(VIEW(it), "elm.swallow.icon", it->icon);
|
|
|
|
evas_object_show(it->icon);
|
|
|
|
elm_widget_sub_object_add(WIDGET(it), it->icon);
|
|
|
|
}
|
2012-09-12 01:46:10 -07:00
|
|
|
|
|
|
|
_item_signal_emit(it);
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-09-27 22:16:04 -07:00
|
|
|
_identical_item_check(Elm_Diskselector_Item_Data *it,
|
2012-07-17 15:09:07 -07:00
|
|
|
Evas_Object *icon)
|
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *dit;
|
2012-07-17 15:09:07 -07:00
|
|
|
Eina_List *l;
|
|
|
|
int idx = 0;
|
|
|
|
int ic = 0;
|
|
|
|
int ac = 0;
|
|
|
|
|
|
|
|
ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd);
|
|
|
|
|
|
|
|
if (sd->round)
|
|
|
|
{
|
|
|
|
// Get index from indentical item from round items
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(sd->r_items, l, dit)
|
2012-07-17 15:09:07 -07:00
|
|
|
{
|
|
|
|
if (it == dit) break;
|
|
|
|
idx++;
|
|
|
|
}
|
|
|
|
|
|
|
|
// No item to match
|
|
|
|
ic = eina_list_count(sd->r_items);
|
|
|
|
|
|
|
|
if (idx >= ic) return;
|
|
|
|
dit = NULL;
|
|
|
|
|
|
|
|
// Number of added items: CEIL(sd->display_item_num)
|
|
|
|
ac = CEIL(sd->display_item_num);
|
|
|
|
|
|
|
|
if (((idx >= 0) && (idx < ac)) ||
|
|
|
|
((idx >= ac) && (idx < (2 * ac))))
|
|
|
|
{
|
|
|
|
// Selected item: under, low region
|
|
|
|
dit = eina_list_nth(sd->r_items,
|
|
|
|
idx + ic - (2 * ac));
|
|
|
|
}
|
|
|
|
else if (((idx >= (ic - ac)) && (idx < ic)) ||
|
|
|
|
((idx >= (ic - (2 * ac))) && (idx < ic - ac)))
|
|
|
|
{
|
|
|
|
// Selected item: over, high region
|
|
|
|
dit = eina_list_nth(sd->r_items,
|
|
|
|
idx - ic + (2 * ac));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dit) _item_icon_set(dit, icon);
|
2012-11-25 22:32:53 -08:00
|
|
|
_sizing_eval(WIDGET(it));
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_diskselector_item_elm_widget_item_part_content_set(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
|
2012-07-17 15:09:07 -07:00
|
|
|
const char *part,
|
|
|
|
Evas_Object *content)
|
|
|
|
{
|
|
|
|
if (part && strcmp(part, "icon")) return;
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
_item_icon_set(it, content);
|
|
|
|
_identical_item_check(it, content);
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
EOLIAN static Evas_Object *
|
|
|
|
_elm_diskselector_item_elm_widget_item_part_content_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
|
2012-07-17 15:09:07 -07:00
|
|
|
const char *part)
|
|
|
|
{
|
|
|
|
if (part && strcmp(part, "icon")) return NULL;
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
return it->icon;
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_click_cb(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *emission EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
2012-07-17 15:09:07 -07:00
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it = data;
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
if (!it) return;
|
|
|
|
ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd);
|
2014-11-25 04:54:52 -08:00
|
|
|
Elm_Object_Item *eo_it = EO_OBJ(it);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
if (sd->selected_item != it)
|
|
|
|
{
|
|
|
|
sd->selected_item = it;
|
|
|
|
_selected_item_indicate(sd->selected_item);
|
|
|
|
}
|
|
|
|
|
2014-11-25 04:54:52 -08:00
|
|
|
if (it->func) it->func((void *)WIDGET_ITEM_DATA_GET(eo_it), WIDGET(it), eo_it);
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED, eo_it);
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
|
|
|
|
2012-08-18 06:52:03 -07:00
|
|
|
static char *
|
2014-01-06 06:30:02 -08:00
|
|
|
_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
|
2012-08-18 06:52:03 -07:00
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it = (Elm_Diskselector_Item_Data *)data;
|
2012-08-18 06:52:03 -07:00
|
|
|
const char *txt = NULL;
|
|
|
|
if (!it) return NULL;
|
|
|
|
|
|
|
|
if (!txt) txt = it->label;
|
|
|
|
if (txt) return strdup(txt);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_access_on_highlight_cb(void *data)
|
|
|
|
{
|
|
|
|
Evas_Coord bx, by, bw, bh;
|
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it = (Elm_Diskselector_Item_Data *)data;
|
2012-08-18 06:52:03 -07:00
|
|
|
|
|
|
|
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd);
|
|
|
|
|
|
|
|
evas_smart_objects_calculate(evas_object_evas_get(sd->main_box));
|
|
|
|
evas_object_geometry_get(sd->main_box, &bx, &by, &bw, &bh);
|
|
|
|
evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
|
|
|
|
|
|
|
|
x -= bx;
|
|
|
|
y -= by;
|
|
|
|
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do(WIDGET(it), elm_interface_scrollable_region_bring_in(x, y, w, h));
|
2012-08-18 06:52:03 -07:00
|
|
|
}
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_diskselector_item_eo_base_constructor(Eo *eo_it, Elm_Diskselector_Item_Data *it)
|
|
|
|
{
|
|
|
|
eo_do_super(eo_it, ELM_DISKSELECTOR_ITEM_CLASS, eo_constructor());
|
|
|
|
it->base = eo_data_scope_get(eo_it, ELM_WIDGET_ITEM_CLASS);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Elm_Diskselector_Item_Data *
|
2012-07-17 15:09:07 -07:00
|
|
|
_item_new(Evas_Object *obj,
|
|
|
|
Evas_Object *icon,
|
|
|
|
const char *label,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *data)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
Eo *eo_it = eo_add(ELM_DISKSELECTOR_ITEM_CLASS, obj);
|
|
|
|
if (!eo_it) return NULL;
|
|
|
|
ELM_DISKSELECTOR_ITEM_DATA_GET(eo_it, it);
|
2011-12-30 02:53:37 -08:00
|
|
|
|
2010-10-07 11:44:43 -07:00
|
|
|
it->label = eina_stringshare_add(label);
|
|
|
|
it->func = func;
|
2014-11-25 04:54:52 -08:00
|
|
|
WIDGET_ITEM_DATA_SET(eo_it, data);
|
2011-10-20 18:08:01 -07:00
|
|
|
VIEW(it) = edje_object_add(evas_object_evas_get(obj));
|
2014-01-08 00:42:55 -08:00
|
|
|
elm_widget_theme_object_set(obj, VIEW(it), "diskselector", "item",
|
|
|
|
elm_widget_style_get(obj));
|
2012-05-21 03:30:47 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
evas_object_size_hint_weight_set
|
|
|
|
(VIEW(it), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(VIEW(it), EVAS_HINT_FILL, EVAS_HINT_FILL);
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_show(VIEW(it));
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2012-09-12 01:46:10 -07:00
|
|
|
if (icon)
|
2014-09-27 22:16:04 -07:00
|
|
|
eo_do(eo_it, elm_wdg_item_part_content_set("icon", icon));
|
2012-09-12 01:46:10 -07:00
|
|
|
|
2010-10-07 11:44:43 -07:00
|
|
|
if (it->label)
|
2011-04-06 21:54:55 -07:00
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
eo_do(eo_it, elm_wdg_item_part_text_set("default", it->label));
|
2012-07-17 15:09:07 -07:00
|
|
|
edje_object_signal_callback_add
|
2013-10-05 05:35:27 -07:00
|
|
|
(VIEW(it), "elm,action,click", "*", _item_click_cb, it);
|
2011-04-06 21:54:55 -07:00
|
|
|
}
|
|
|
|
|
2012-08-18 06:52:03 -07:00
|
|
|
//XXX: ACCESS
|
2012-11-08 00:02:12 -08:00
|
|
|
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
|
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
_elm_access_widget_item_register(it->base);
|
2012-11-08 00:02:12 -08:00
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
_elm_access_text_set(_elm_access_info_get(it->base->access_obj),
|
2012-11-08 00:02:12 -08:00
|
|
|
ELM_ACCESS_TYPE, E_("diskselector item"));
|
2014-09-27 22:16:04 -07:00
|
|
|
_elm_access_callback_set(_elm_access_info_get(it->base->access_obj),
|
2012-11-08 00:02:12 -08:00
|
|
|
ELM_ACCESS_INFO,
|
|
|
|
_access_info_cb, it);
|
|
|
|
_elm_access_on_highlight_hook_set(
|
2014-09-27 22:16:04 -07:00
|
|
|
_elm_access_info_get(it->base->access_obj), _access_on_highlight_cb,
|
2012-11-08 00:02:12 -08:00
|
|
|
it);
|
|
|
|
}
|
2012-08-18 06:52:03 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
return it;
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
static Evas_Object *
|
|
|
|
_blank_add(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Evas_Object *blank;
|
|
|
|
blank = edje_object_add(evas_object_evas_get(obj));
|
|
|
|
elm_widget_theme_object_set(obj, blank, "diskselector", "item", "default");
|
|
|
|
evas_object_size_hint_weight_set(blank, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(blank, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
|
|
|
|
return blank;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_blank_item_check(Evas_Object *obj, int item_num)
|
|
|
|
{
|
|
|
|
Evas_Object *blank;
|
|
|
|
Eina_List *last;
|
|
|
|
int diff, i;
|
|
|
|
|
|
|
|
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
diff = (item_num / 2) - eina_list_count(sd->left_blanks);
|
|
|
|
if (!diff) return;
|
|
|
|
|
|
|
|
/* left blank */
|
|
|
|
for (i = 0; i < ((diff > 0) ? (diff) : (-diff)); i++)
|
|
|
|
{
|
|
|
|
if (diff > 0)
|
|
|
|
{
|
|
|
|
blank = _blank_add(obj);
|
|
|
|
elm_box_pack_start(sd->main_box, blank);
|
|
|
|
evas_object_show(blank);
|
|
|
|
sd->left_blanks = eina_list_append(sd->left_blanks, blank);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
last = eina_list_last(sd->left_blanks);
|
|
|
|
blank = eina_list_data_get(last);
|
|
|
|
elm_box_unpack(sd->main_box, blank);
|
|
|
|
evas_object_del(blank);
|
|
|
|
sd->left_blanks = eina_list_remove_list(sd->left_blanks, last);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* right blank */
|
|
|
|
for (i = 0; i < ((diff > 0) ? (diff) : (-diff)); i++)
|
|
|
|
{
|
|
|
|
if (diff > 0)
|
|
|
|
{
|
|
|
|
blank = _blank_add(obj);
|
|
|
|
elm_box_pack_end(sd->main_box, blank);
|
|
|
|
evas_object_show(blank);
|
|
|
|
sd->right_blanks = eina_list_append(sd->right_blanks, blank);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
last = eina_list_last(sd->right_blanks);
|
|
|
|
blank = eina_list_data_get(last);
|
|
|
|
elm_box_unpack(sd->main_box, blank);
|
|
|
|
evas_object_del(blank);
|
|
|
|
sd->right_blanks = eina_list_remove_list(sd->right_blanks, last);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-07 11:44:43 -07:00
|
|
|
static void
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
_theme_data_get(Evas_Object *obj)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
const char *str;
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
Evas_Object *blank;
|
2011-04-06 21:54:55 -07:00
|
|
|
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
blank = eina_list_data_get(sd->right_blanks);
|
|
|
|
if (blank) return;
|
|
|
|
|
|
|
|
str = edje_object_data_get(blank, "len_threshold");
|
2012-07-17 15:09:07 -07:00
|
|
|
if (str) sd->len_threshold = MAX(0, atoi(str));
|
|
|
|
else sd->len_threshold = 0;
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (!sd->display_item_num_by_api)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
str = edje_object_data_get(blank, "display_item_num");
|
|
|
|
if (str)
|
|
|
|
{
|
|
|
|
sd->display_item_num = MAX(DISPLAY_ITEM_NUM_MIN, atoi(str));
|
2012-10-15 01:43:14 -07:00
|
|
|
if (!sd->round) _blank_item_check(obj, sd->display_item_num);
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
}
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
else sd->display_item_num = DISPLAY_ITEM_NUM_MIN;
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
str = edje_object_data_get(blank, "min_width");
|
2012-07-17 15:09:07 -07:00
|
|
|
if (str) sd->minw = MAX(-1, atoi(str));
|
|
|
|
else sd->minw = -1;
|
2011-04-06 21:54:55 -07:00
|
|
|
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
str = edje_object_data_get(blank, "min_height");
|
2012-07-17 15:09:07 -07:00
|
|
|
if (str) sd->minh = MAX(-1, atoi(str));
|
|
|
|
else sd->minh = -1;
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_diskselector_elm_widget_theme_apply(Eo *obj, Elm_Diskselector_Data *sd)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
|
|
|
Eina_List *l;
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it;
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
Evas_Object *blank;
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool int_ret = EINA_FALSE;
|
2013-01-22 02:48:56 -08:00
|
|
|
Evas *evas;
|
2014-01-08 00:42:55 -08:00
|
|
|
const char *style = elm_widget_style_get(obj);
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2014-04-03 07:10:04 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply());
|
2014-03-21 08:27:17 -07:00
|
|
|
if (!int_ret) return EINA_FALSE;
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2013-01-22 02:48:56 -08:00
|
|
|
evas = evas_object_evas_get(obj);
|
|
|
|
evas_event_freeze(evas);
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (sd->round)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(sd->r_items, l, it)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2014-01-08 00:42:55 -08:00
|
|
|
elm_widget_theme_object_set(obj, VIEW(it),
|
|
|
|
"diskselector", "item", style);
|
2012-07-17 15:09:07 -07:00
|
|
|
edje_object_part_text_escaped_set
|
|
|
|
(VIEW(it), "elm.text", it->label);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(sd->items, l, it)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2014-01-08 00:42:55 -08:00
|
|
|
elm_widget_theme_object_set(obj, VIEW(it),
|
|
|
|
"diskselector","item", style);
|
2012-07-17 15:09:07 -07:00
|
|
|
edje_object_part_text_escaped_set
|
|
|
|
(VIEW(it), "elm.text", it->label);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
|
|
|
|
/* left blank */
|
|
|
|
EINA_LIST_FOREACH (sd->left_blanks, l, blank)
|
|
|
|
{
|
2014-01-08 00:42:55 -08:00
|
|
|
elm_widget_theme_object_set(obj, blank,
|
|
|
|
"diskselector", "item", style);
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* right blank */
|
|
|
|
EINA_LIST_FOREACH (sd->right_blanks, l, blank)
|
|
|
|
{
|
2014-01-08 00:42:55 -08:00
|
|
|
elm_widget_theme_object_set(obj, blank,
|
|
|
|
"diskselector", "item", style);
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
}
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
_theme_data_get(obj);
|
2010-10-07 11:44:43 -07:00
|
|
|
_sizing_eval(obj);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2013-01-22 02:48:56 -08:00
|
|
|
evas_event_thaw(evas);
|
|
|
|
evas_event_thaw_eval(evas);
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
return EINA_TRUE;
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_diskselector_elm_widget_sub_object_del(Eo *obj, Elm_Diskselector_Data *sd, Evas_Object *sobj)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool int_ret = EINA_FALSE;
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it;
|
2010-10-07 11:44:43 -07:00
|
|
|
const Eina_List *l;
|
|
|
|
|
2014-04-03 07:10:04 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_sub_object_del(sobj));
|
2014-03-21 08:27:17 -07:00
|
|
|
if (!int_ret) return EINA_FALSE;
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(sd->items, l, it)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
if (sobj == it->icon)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
it->icon = NULL;
|
|
|
|
|
|
|
|
_sizing_eval(obj);
|
|
|
|
break;
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
return EINA_TRUE;
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_diskselector_elm_widget_on_focus(Eo *obj, Elm_Diskselector_Data *_pd EINA_UNUSED)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool int_ret = EINA_FALSE;
|
2014-03-21 08:27:17 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2014-04-03 07:10:04 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_on_focus());
|
2014-03-21 08:27:17 -07:00
|
|
|
if (!int_ret) return EINA_FALSE;
|
2010-10-07 11:44:43 -07:00
|
|
|
|
|
|
|
if (elm_widget_focus_get(obj))
|
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
edje_object_signal_emit
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj, "elm,action,focus", "elm");
|
|
|
|
evas_object_focus_set(wd->resize_obj, EINA_TRUE);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
edje_object_signal_emit
|
2012-11-25 22:32:53 -08:00
|
|
|
(wd->resize_obj, "elm,action,unfocus", "elm");
|
|
|
|
evas_object_focus_set(wd->resize_obj, EINA_FALSE);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
return EINA_TRUE;
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static Eina_Bool _elm_diskselector_smart_focus_next_enable = EINA_FALSE;
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_diskselector_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *_pd EINA_UNUSED)
|
2012-08-18 06:52:03 -07:00
|
|
|
{
|
2014-03-21 08:27:17 -07:00
|
|
|
return _elm_diskselector_smart_focus_next_enable;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_diskselector_elm_widget_focus_next(Eo *obj, Elm_Diskselector_Data *sd, Elm_Focus_Direction dir, Evas_Object **next)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-08-18 06:52:03 -07:00
|
|
|
Eina_List *items = NULL;
|
|
|
|
Eina_List *elist = NULL;
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it;
|
2012-08-18 06:52:03 -07:00
|
|
|
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(sd->items, elist, it)
|
2014-09-27 22:16:04 -07:00
|
|
|
items = eina_list_append(items, it->base->access_obj);
|
2012-08-18 06:52:03 -07:00
|
|
|
|
|
|
|
if (!sd->round)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-21 08:27:17 -07:00
|
|
|
return elm_widget_focus_list_next_get
|
2012-08-18 06:52:03 -07:00
|
|
|
(obj, items, eina_list_data_get, dir, next);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-18 06:52:03 -07:00
|
|
|
|
|
|
|
if (!elm_widget_focus_list_next_get
|
|
|
|
(obj, items, eina_list_data_get, dir, next))
|
|
|
|
{
|
|
|
|
elm_widget_focused_object_clear((Evas_Object *)obj);
|
|
|
|
elm_widget_focus_list_next_get
|
|
|
|
(obj, items, eina_list_data_get, dir, next);
|
|
|
|
}
|
2014-03-21 08:27:17 -07:00
|
|
|
return EINA_TRUE;
|
2012-08-18 06:52:03 -07:00
|
|
|
}
|
|
|
|
|
2014-03-31 19:10:25 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_key_action_move(Evas_Object *obj, const char *params)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2014-03-31 19:10:25 -07:00
|
|
|
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it = NULL;
|
2014-03-31 19:10:25 -07:00
|
|
|
Eina_List *l = NULL;
|
2014-04-01 06:20:58 -07:00
|
|
|
const char *dir = params;
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2014-03-31 19:10:25 -07:00
|
|
|
if (!strcmp(dir, "prev"))
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
l = sd->selected_item->node->prev;
|
|
|
|
if ((!l) && (sd->round))
|
|
|
|
l = eina_list_last(sd->items);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
2014-03-31 19:10:25 -07:00
|
|
|
else if (!strcmp(dir, "next"))
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
l = sd->selected_item->node->next;
|
|
|
|
if ((!l) && (sd->round))
|
|
|
|
l = sd->items;
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
2014-03-31 19:10:25 -07:00
|
|
|
else if (!strcmp(dir, "first"))
|
2012-07-17 15:09:07 -07:00
|
|
|
l = sd->items;
|
2014-03-31 19:10:25 -07:00
|
|
|
else if (!strcmp(dir, "last"))
|
2012-07-17 15:09:07 -07:00
|
|
|
l = eina_list_last(sd->items);
|
2014-03-21 08:27:17 -07:00
|
|
|
else return EINA_FALSE;
|
2010-10-07 11:44:43 -07:00
|
|
|
|
|
|
|
if (l)
|
|
|
|
it = eina_list_data_get(l);
|
|
|
|
|
|
|
|
if (it)
|
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->selected_item = it;
|
2013-01-22 02:49:00 -08:00
|
|
|
if (!sd->scroller_move_idle_enterer)
|
|
|
|
sd->scroller_move_idle_enterer = ecore_idle_enterer_before_add(_scroller_move, obj);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2014-03-31 19:10:25 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_diskselector_elm_widget_event(Eo *obj, Elm_Diskselector_Data *sd, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
|
|
|
{
|
|
|
|
Evas_Event_Key_Down *ev = event_info;
|
|
|
|
|
|
|
|
(void) src;
|
|
|
|
|
|
|
|
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
|
|
|
|
|
|
|
if (!sd->selected_item)
|
|
|
|
{
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!_elm_config_key_binding_call(obj, ev, key_actions))
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
2010-10-07 11:44:43 -07:00
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
2014-03-21 08:27:17 -07:00
|
|
|
return EINA_TRUE;
|
2011-04-06 21:54:55 -07:00
|
|
|
}
|
|
|
|
|
2010-10-07 11:44:43 -07:00
|
|
|
static void
|
2012-07-17 15:09:07 -07:00
|
|
|
_scroll_cb(Evas_Object *obj,
|
2014-01-06 06:30:02 -08:00
|
|
|
void *data EINA_UNUSED)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-09-13 04:55:24 -07:00
|
|
|
Evas_Coord x, y, w, h, bw, x_boundary;
|
|
|
|
unsigned int adjust_pixels;
|
|
|
|
Eina_Bool h_bounce;
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
_string_check(obj);
|
|
|
|
eo_do(obj,
|
2014-03-17 04:44:40 -07:00
|
|
|
elm_interface_scrollable_content_pos_get(&x, &y),
|
entry: wrong viewport value calculation issue fix
Summary:
Issue: As entire scroller edje co-ordinates was being taken instead of the actual viewport value,
if in scroller edje more parts are added apart from just "elm.swallow.content", then the viewport value
set will be wrong. hence the selection handlers will not hide when they have to hide.
solution: Instead of taking scroller edje's geometry, get the actual viewport values.
To get viewport x,y a new scrollable interface is also added.
signed-off by: Shilpa Singh <shilpa.singh@samsung.com>
@fix
Test Plan: Selection handlers have to hide correctly when the text is scrolled in a scrolled entry, if the scroller edc of entry has more parts added other than elm.swallow.content, then when we scroll the selection handlers are not hidden correctly.
Reviewers: jaehwan, woohyun, seoz, Hermet, raster
CC: govi, rajeshps, thiepha
Differential Revision: https://phab.enlightenment.org/D674
2014-04-20 20:31:49 -07:00
|
|
|
elm_interface_scrollable_content_viewport_geometry_get
|
|
|
|
(NULL, NULL, &w, &h));
|
2012-07-17 15:09:07 -07:00
|
|
|
if (sd->round)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
evas_object_geometry_get(sd->main_box, NULL, NULL, &bw, NULL);
|
2012-09-13 04:55:24 -07:00
|
|
|
x_boundary = bw - w;
|
|
|
|
|
|
|
|
if (x >= x_boundary)
|
|
|
|
{
|
|
|
|
if (sd->left_boundary_reached) return;
|
|
|
|
|
|
|
|
sd->right_boundary_reached = EINA_TRUE;
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do(obj, elm_interface_scrollable_bounce_allow_get(&h_bounce, NULL));
|
2012-09-13 04:55:24 -07:00
|
|
|
/* If scroller's bounce effect is disabled, add 1 pixel
|
|
|
|
* to provide circular effect */
|
|
|
|
adjust_pixels = (_elm_config->thumbscroll_bounce_enable
|
|
|
|
&& h_bounce) ? 0 : 1;
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do(obj, elm_interface_scrollable_content_region_show
|
2012-11-25 22:32:53 -08:00
|
|
|
(x - x_boundary + adjust_pixels, y, w, h));
|
2012-09-13 04:55:24 -07:00
|
|
|
sd->left_boundary_reached = EINA_FALSE;
|
|
|
|
}
|
|
|
|
else if (x <= 0)
|
|
|
|
{
|
|
|
|
if (sd->right_boundary_reached) return;
|
|
|
|
|
|
|
|
sd->left_boundary_reached = EINA_TRUE;
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do(obj, elm_interface_scrollable_bounce_allow_get(&h_bounce, NULL));
|
2012-09-13 04:55:24 -07:00
|
|
|
/* If scroller's bounce effect is disabled, subtract 1 pixel
|
|
|
|
* to provide circular effect */
|
|
|
|
adjust_pixels = (_elm_config->thumbscroll_bounce_enable
|
|
|
|
&& h_bounce) ? 0 : 1;
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do(obj, elm_interface_scrollable_content_region_show
|
2012-11-25 22:32:53 -08:00
|
|
|
(x + x_boundary - adjust_pixels, y, w, h));
|
2012-09-13 04:55:24 -07:00
|
|
|
sd->right_boundary_reached = EINA_FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sd->left_boundary_reached = EINA_FALSE;
|
|
|
|
sd->right_boundary_reached = EINA_FALSE;
|
|
|
|
}
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-17 15:09:07 -07:00
|
|
|
_scroll_animate_stop_cb(Evas_Object *obj,
|
2014-01-06 06:30:02 -08:00
|
|
|
void *data EINA_UNUSED)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it;
|
2012-09-28 01:48:48 -07:00
|
|
|
Evas_Coord x, w, ox, ow;
|
2010-10-07 11:44:43 -07:00
|
|
|
Eina_List *l, *list;
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2013-01-22 02:49:00 -08:00
|
|
|
if (sd->scroller_move_idle_enterer) return;
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
if (!sd->round)
|
|
|
|
list = sd->items;
|
2010-10-07 11:44:43 -07:00
|
|
|
else
|
2012-07-17 15:09:07 -07:00
|
|
|
list = sd->r_items;
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2012-09-28 01:48:48 -07:00
|
|
|
evas_object_geometry_get(obj, &ox, NULL, &ow, NULL);
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(list, l, it)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_geometry_get(VIEW(it), &x, NULL, &w, NULL);
|
2012-09-28 01:48:48 -07:00
|
|
|
if (abs((int)(ox + (ow / 2)) - (int)(x + (w / 2))) < 10) break;
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2011-12-30 02:53:37 -08:00
|
|
|
if (!it) return;
|
2012-07-17 15:09:07 -07:00
|
|
|
_item_select(it);
|
2014-09-27 22:16:04 -07:00
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_STOP, EO_OBJ(it));
|
2012-03-14 05:29:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-17 15:09:07 -07:00
|
|
|
_scroll_animate_start_cb(Evas_Object *obj,
|
2014-01-06 06:30:02 -08:00
|
|
|
void *data EINA_UNUSED)
|
2012-03-14 05:29:22 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
evas_object_smart_callback_call
|
|
|
|
(obj, SIG_SCROLL_ANIM_START, elm_diskselector_selected_item_get(obj));
|
2012-03-14 05:29:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-17 15:09:07 -07:00
|
|
|
_scroll_drag_start_cb(Evas_Object *obj,
|
2014-01-06 06:30:02 -08:00
|
|
|
void *data EINA_UNUSED)
|
2012-03-14 05:29:22 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
evas_object_smart_callback_call
|
|
|
|
(obj, SIG_SCROLL_DRAG_START, elm_diskselector_selected_item_get(obj));
|
2012-03-14 05:29:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-17 15:09:07 -07:00
|
|
|
_scroll_drag_stop_cb(Evas_Object *obj,
|
2014-01-06 06:30:02 -08:00
|
|
|
void *data EINA_UNUSED)
|
2012-03-14 05:29:22 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
evas_object_smart_callback_call
|
|
|
|
(obj, SIG_SCROLL_DRAG_STOP, elm_diskselector_selected_item_get(obj));
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-09-17 06:44:05 -07:00
|
|
|
_round_item_del(Elm_Diskselector_Data *sd EINA_UNUSED,
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
|
|
|
if (!it) return;
|
2014-08-19 00:52:24 -07:00
|
|
|
eo_del(EO_OBJ(it));
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-21 08:27:17 -07:00
|
|
|
_round_items_del(Elm_Diskselector_Data *sd)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2011-04-06 21:54:55 -07:00
|
|
|
Eina_List *l;
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it;
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
_round_item_del(sd, sd->last);
|
|
|
|
sd->last = NULL;
|
|
|
|
_round_item_del(sd, sd->s_last);
|
|
|
|
sd->s_last = NULL;
|
|
|
|
_round_item_del(sd, sd->second);
|
|
|
|
sd->second = NULL;
|
|
|
|
_round_item_del(sd, sd->first);
|
|
|
|
sd->first = NULL;
|
|
|
|
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(sd->under_items, l, it)
|
2011-04-06 21:54:55 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
_round_item_del(sd, it);
|
2011-04-06 21:54:55 -07:00
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->under_items = eina_list_free(sd->under_items);
|
2011-04-06 21:54:55 -07:00
|
|
|
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(sd->over_items, l, it)
|
2011-04-06 21:54:55 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
_round_item_del(sd, it);
|
2011-04-06 21:54:55 -07:00
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->over_items = eina_list_free(sd->over_items);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2012-07-06 00:08:16 -07:00
|
|
|
static Evas_Object *
|
2012-07-17 15:09:07 -07:00
|
|
|
_icon_duplicate(Evas_Object *icon)
|
2012-07-06 00:08:16 -07:00
|
|
|
{
|
|
|
|
Evas_Object *ic;
|
|
|
|
const char *file;
|
|
|
|
const char *group;
|
|
|
|
|
2012-08-30 00:54:18 -07:00
|
|
|
if (!icon) return NULL;
|
|
|
|
|
2012-07-06 00:08:16 -07:00
|
|
|
elm_image_file_get(icon, &file, &group);
|
|
|
|
ic = elm_icon_add(icon);
|
2012-07-17 15:09:07 -07:00
|
|
|
elm_image_file_set(ic, file, group);
|
2014-01-07 15:23:58 -08:00
|
|
|
elm_image_resizable_set(ic, EINA_TRUE, EINA_TRUE);
|
2012-07-06 00:08:16 -07:00
|
|
|
|
|
|
|
return ic;
|
|
|
|
}
|
|
|
|
|
2010-10-07 11:44:43 -07:00
|
|
|
static void
|
2014-03-21 08:27:17 -07:00
|
|
|
_round_items_add(Elm_Diskselector_Data *sd)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *temp_it;
|
|
|
|
Elm_Diskselector_Item_Data *dit;
|
|
|
|
Elm_Diskselector_Item_Data *it;
|
2011-04-06 21:54:55 -07:00
|
|
|
int i = 0;
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
dit = it = eina_list_nth(sd->items, 0);
|
2010-10-07 11:44:43 -07:00
|
|
|
if (!dit) return;
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (!sd->first)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->first = _item_new
|
|
|
|
(WIDGET(it), _icon_duplicate(it->icon), it->label, it->func,
|
2014-09-14 04:51:26 -07:00
|
|
|
WIDGET_ITEM_DATA_GET(EO_OBJ(it)));
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->first->node = it->node;
|
|
|
|
sd->r_items = eina_list_append(sd->r_items, sd->first);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
it = eina_list_nth(sd->items, 1);
|
2010-10-07 11:44:43 -07:00
|
|
|
if (!it)
|
|
|
|
it = dit;
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
if (!sd->second)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->second = _item_new
|
|
|
|
(WIDGET(it), _icon_duplicate(it->icon), it->label, it->func,
|
2014-09-14 04:51:26 -07:00
|
|
|
WIDGET_ITEM_DATA_GET(EO_OBJ(it)));
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->second->node = it->node;
|
|
|
|
sd->r_items = eina_list_append(sd->r_items, sd->second);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2011-04-06 21:54:55 -07:00
|
|
|
// if more than 3 itmes should be displayed
|
2012-07-17 15:09:07 -07:00
|
|
|
for (i = 2; i < CEIL(sd->display_item_num); i++)
|
2011-04-06 21:54:55 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
it = eina_list_nth(sd->items, i);
|
|
|
|
|
2011-04-06 21:54:55 -07:00
|
|
|
if (!it) it = dit;
|
2012-07-17 15:09:07 -07:00
|
|
|
temp_it = _item_new
|
|
|
|
(WIDGET(it), _icon_duplicate
|
2014-09-14 04:51:26 -07:00
|
|
|
(it->icon), it->label, it->func, WIDGET_ITEM_DATA_GET(EO_OBJ(it)));
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->over_items = eina_list_append(sd->over_items, temp_it);
|
|
|
|
sd->r_items = eina_list_append(sd->r_items, temp_it);
|
2011-04-06 21:54:55 -07:00
|
|
|
}
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
it = eina_list_nth(sd->items, sd->item_count - 1);
|
2010-10-07 11:44:43 -07:00
|
|
|
if (!it)
|
|
|
|
it = dit;
|
2012-07-17 15:09:07 -07:00
|
|
|
if (!sd->last)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->last = _item_new
|
|
|
|
(WIDGET(it), _icon_duplicate(it->icon), it->label, it->func,
|
2014-09-14 04:51:26 -07:00
|
|
|
WIDGET_ITEM_DATA_GET(EO_OBJ(it)));
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->last->node = it->node;
|
|
|
|
sd->r_items = eina_list_prepend(sd->r_items, sd->last);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
it = eina_list_nth(sd->items, sd->item_count - 2);
|
2010-10-07 11:44:43 -07:00
|
|
|
if (!it)
|
|
|
|
it = dit;
|
2012-07-17 15:09:07 -07:00
|
|
|
if (!sd->s_last)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->s_last = _item_new
|
|
|
|
(WIDGET(it), _icon_duplicate(it->icon), it->label, it->func,
|
2014-09-14 04:51:26 -07:00
|
|
|
WIDGET_ITEM_DATA_GET(EO_OBJ(it)));
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->s_last->node = it->node;
|
|
|
|
sd->r_items = eina_list_prepend(sd->r_items, sd->s_last);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
2011-04-06 21:54:55 -07:00
|
|
|
|
|
|
|
// if more than 3 itmes should be displayed
|
2012-07-17 15:09:07 -07:00
|
|
|
for (i = 3; i <= CEIL(sd->display_item_num); i++)
|
2011-04-06 21:54:55 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
it = eina_list_nth(sd->items, sd->item_count - i);
|
2011-04-06 21:54:55 -07:00
|
|
|
if (!it) it = dit;
|
2012-07-17 15:09:07 -07:00
|
|
|
temp_it = _item_new
|
|
|
|
(WIDGET(it), _icon_duplicate
|
2014-09-14 04:51:26 -07:00
|
|
|
(it->icon), it->label, it->func, WIDGET_ITEM_DATA_GET(EO_OBJ(it)));
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->under_items = eina_list_append(sd->under_items, temp_it);
|
|
|
|
sd->r_items = eina_list_prepend(sd->r_items, temp_it);
|
2011-04-06 21:54:55 -07:00
|
|
|
}
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static void
|
2014-06-03 03:35:28 -07:00
|
|
|
_elm_diskselector_evas_object_smart_add(Eo *obj, Elm_Diskselector_Data *priv)
|
2011-10-10 02:45:43 -07:00
|
|
|
{
|
2013-01-22 02:48:56 -08:00
|
|
|
Evas *evas;
|
2013-02-16 05:39:59 -08:00
|
|
|
Evas_Object *blank, *edje;
|
2013-01-22 02:48:56 -08:00
|
|
|
|
2013-09-24 21:33:39 -07:00
|
|
|
elm_widget_sub_object_parent_add(obj);
|
2013-08-26 08:29:45 -07:00
|
|
|
|
2013-01-22 02:48:56 -08:00
|
|
|
evas = evas_object_evas_get(obj);
|
|
|
|
evas_event_freeze(evas);
|
2012-05-21 03:30:47 -07:00
|
|
|
|
2013-03-29 10:53:22 -07:00
|
|
|
edje = edje_object_add(evas);
|
2013-10-16 08:54:54 -07:00
|
|
|
elm_widget_resize_object_set(obj, edje, EINA_TRUE);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
elm_widget_theme_object_set
|
2013-02-16 05:39:59 -08:00
|
|
|
(obj, edje, "diskselector", "base", elm_widget_style_get(obj));
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2013-03-29 10:53:22 -07:00
|
|
|
priv->hit_rect = evas_object_rectangle_add(evas);
|
2012-07-17 15:09:07 -07:00
|
|
|
evas_object_smart_member_add(priv->hit_rect, obj);
|
|
|
|
elm_widget_sub_object_add(obj, priv->hit_rect);
|
|
|
|
|
|
|
|
/* common scroller hit rectangle setup */
|
|
|
|
evas_object_color_set(priv->hit_rect, 0, 0, 0, 0);
|
|
|
|
evas_object_show(priv->hit_rect);
|
|
|
|
evas_object_repeat_events_set(priv->hit_rect, EINA_TRUE);
|
|
|
|
|
|
|
|
elm_widget_can_focus_set(obj, EINA_TRUE);
|
|
|
|
|
|
|
|
priv->len_side = 3;
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj,
|
2014-03-17 04:44:40 -07:00
|
|
|
elm_interface_scrollable_objects_set(edje, priv->hit_rect),
|
2014-04-03 07:10:04 -07:00
|
|
|
elm_obj_widget_theme_apply(),
|
2014-03-17 04:44:40 -07:00
|
|
|
elm_interface_scrollable_policy_set(ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF),
|
|
|
|
elm_interface_scrollable_bounce_allow_set(EINA_TRUE, EINA_FALSE),
|
|
|
|
elm_interface_scrollable_animate_start_cb_set(_scroll_animate_start_cb),
|
|
|
|
elm_interface_scrollable_animate_stop_cb_set(_scroll_animate_stop_cb),
|
|
|
|
elm_interface_scrollable_drag_start_cb_set(_scroll_drag_start_cb),
|
|
|
|
elm_interface_scrollable_drag_stop_cb_set(_scroll_drag_stop_cb),
|
|
|
|
elm_interface_scrollable_scroll_cb_set(_scroll_cb));
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize_cb, NULL);
|
|
|
|
|
|
|
|
priv->main_box = elm_box_add(obj);
|
|
|
|
elm_box_horizontal_set(priv->main_box, EINA_TRUE);
|
|
|
|
elm_box_homogeneous_set(priv->main_box, EINA_TRUE);
|
|
|
|
evas_object_size_hint_weight_set
|
|
|
|
(priv->main_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set
|
|
|
|
(priv->main_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
2013-05-13 06:36:10 -07:00
|
|
|
elm_widget_theme_set(priv->main_box, elm_widget_theme_get(obj));
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
elm_widget_sub_object_add(obj, priv->main_box);
|
|
|
|
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do(obj, elm_interface_scrollable_content_set(priv->main_box));
|
2012-07-17 15:09:07 -07:00
|
|
|
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
/* left blank */
|
|
|
|
blank = _blank_add(obj);
|
|
|
|
elm_box_pack_start(priv->main_box, blank);
|
|
|
|
evas_object_show(blank);
|
|
|
|
priv->left_blanks = eina_list_append(priv->left_blanks, blank);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
/* right blank */
|
|
|
|
blank = _blank_add(obj);
|
|
|
|
elm_box_pack_end(priv->main_box, blank);
|
|
|
|
evas_object_show(blank);
|
|
|
|
priv->right_blanks = eina_list_append(priv->right_blanks, blank);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
_theme_data_get(obj);
|
2012-07-17 15:09:07 -07:00
|
|
|
_sizing_eval(obj);
|
2013-01-22 02:48:56 -08:00
|
|
|
|
|
|
|
evas_event_thaw(evas);
|
|
|
|
evas_event_thaw_eval(evas);
|
2011-10-10 02:45:43 -07:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static void
|
2014-06-03 03:35:28 -07:00
|
|
|
_elm_diskselector_evas_object_smart_del(Eo *obj, Elm_Diskselector_Data *sd)
|
2011-10-10 02:45:43 -07:00
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it;
|
2014-09-17 06:44:05 -07:00
|
|
|
Eina_List *l, *l2;
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
Evas_Object *blank;
|
2011-10-10 02:45:43 -07:00
|
|
|
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
/* left blank */
|
2014-09-17 06:44:05 -07:00
|
|
|
EINA_LIST_FREE (sd->left_blanks, blank)
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
evas_object_del(blank);
|
|
|
|
|
|
|
|
/* right blank */
|
2014-09-17 06:44:05 -07:00
|
|
|
EINA_LIST_FREE (sd->right_blanks, blank)
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
evas_object_del(blank);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
if (sd->last)
|
2011-10-10 02:45:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
evas_object_del(sd->VIEW(last));
|
2014-08-19 00:52:24 -07:00
|
|
|
eo_del(EO_OBJ(sd->last));
|
2014-09-17 06:44:05 -07:00
|
|
|
sd->last = NULL;
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
2011-10-10 02:45:43 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (sd->s_last)
|
|
|
|
{
|
|
|
|
evas_object_del(sd->VIEW(s_last));
|
2014-08-19 00:52:24 -07:00
|
|
|
eo_del(EO_OBJ(sd->s_last));
|
2014-09-17 06:44:05 -07:00
|
|
|
sd->s_last = NULL;
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
2011-10-10 02:45:43 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (sd->second)
|
|
|
|
{
|
|
|
|
evas_object_del(sd->VIEW(second));
|
2014-08-19 00:52:24 -07:00
|
|
|
eo_del(EO_OBJ(sd->second));
|
2014-09-17 06:44:05 -07:00
|
|
|
sd->second = NULL;
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
2011-10-10 02:45:43 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (sd->first)
|
|
|
|
{
|
|
|
|
evas_object_del(sd->VIEW(first));
|
2014-08-19 00:52:24 -07:00
|
|
|
eo_del(EO_OBJ(sd->first));
|
2014-09-17 06:44:05 -07:00
|
|
|
sd->first = NULL;
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
|
|
|
|
2014-09-17 06:44:05 -07:00
|
|
|
EINA_LIST_FOREACH_SAFE(sd->under_items, l, l2, it)
|
2012-07-17 15:09:07 -07:00
|
|
|
{
|
|
|
|
if (it)
|
2011-10-10 02:45:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
evas_object_del(VIEW(it));
|
2014-08-19 00:52:24 -07:00
|
|
|
eo_del(EO_OBJ(it));
|
2011-10-10 02:45:43 -07:00
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
2014-09-17 06:44:05 -07:00
|
|
|
sd->under_items = eina_list_free(sd->under_items);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2014-09-17 06:44:05 -07:00
|
|
|
EINA_LIST_FOREACH_SAFE(sd->over_items, l, l2, it)
|
2012-07-17 15:09:07 -07:00
|
|
|
{
|
|
|
|
if (it)
|
2011-10-10 02:45:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
evas_object_del(VIEW(it));
|
2014-08-19 00:52:24 -07:00
|
|
|
eo_del(EO_OBJ(it));
|
2011-10-10 02:45:43 -07:00
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
2014-09-17 06:44:05 -07:00
|
|
|
sd->over_items = eina_list_free(sd->over_items);
|
2011-10-10 02:45:43 -07:00
|
|
|
|
2014-09-17 06:44:05 -07:00
|
|
|
EINA_LIST_FOREACH_SAFE(sd->items, l, l2, it)
|
2012-07-17 15:09:07 -07:00
|
|
|
{
|
2014-08-19 00:52:24 -07:00
|
|
|
eo_del(EO_OBJ(it));
|
2012-07-17 15:09:07 -07:00
|
|
|
}
|
2014-09-17 06:44:05 -07:00
|
|
|
sd->items = eina_list_free(sd->items);
|
2013-05-20 09:25:02 -07:00
|
|
|
sd->r_items = eina_list_free(sd->r_items);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2014-01-21 16:55:58 -08:00
|
|
|
ELM_SAFE_FREE(sd->scroller_move_idle_enterer, ecore_idle_enterer_del);
|
|
|
|
ELM_SAFE_FREE(sd->string_check_idle_enterer, ecore_idle_enterer_del);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
|
2011-10-10 02:45:43 -07:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static void
|
2014-06-03 03:35:28 -07:00
|
|
|
_elm_diskselector_evas_object_smart_move(Eo *obj, Elm_Diskselector_Data *sd, Evas_Coord x, Evas_Coord y)
|
2011-12-30 02:53:37 -08:00
|
|
|
{
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y));
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
evas_object_move(sd->hit_rect, x, y);
|
2011-12-30 02:53:37 -08:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static void
|
2014-06-03 03:35:28 -07:00
|
|
|
_elm_diskselector_evas_object_smart_resize(Eo *obj, Elm_Diskselector_Data *sd, Evas_Coord w, Evas_Coord h)
|
2011-12-30 02:53:37 -08:00
|
|
|
{
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_resize(w, h));
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
evas_object_resize(sd->hit_rect, w, h);
|
2011-12-30 02:53:37 -08:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static void
|
2014-06-03 03:35:28 -07:00
|
|
|
_elm_diskselector_evas_object_smart_member_add(Eo *obj, Elm_Diskselector_Data *sd, Evas_Object *member)
|
2011-12-30 02:53:37 -08:00
|
|
|
{
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_member_add(member));
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
if (sd->hit_rect)
|
|
|
|
evas_object_raise(sd->hit_rect);
|
2011-12-30 02:53:37 -08:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static void
|
2014-03-23 04:21:23 -07:00
|
|
|
_elm_diskselector_elm_widget_access(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *_pd EINA_UNUSED, Eina_Bool acs)
|
2012-07-31 15:05:00 -07:00
|
|
|
{
|
2014-03-23 04:21:23 -07:00
|
|
|
_elm_diskselector_smart_focus_next_enable = acs;
|
2012-07-31 15:05:00 -07:00
|
|
|
}
|
|
|
|
|
2010-10-07 11:44:43 -07:00
|
|
|
EAPI Evas_Object *
|
2010-11-10 05:28:32 -08:00
|
|
|
elm_diskselector_add(Evas_Object *parent)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *obj = eo_add(MY_CLASS, parent);
|
|
|
|
return obj;
|
|
|
|
}
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_diskselector_eo_base_constructor(Eo *obj, Elm_Diskselector_Data *_pd EINA_UNUSED)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, eo_constructor());
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj,
|
2013-11-07 03:44:22 -08:00
|
|
|
evas_obj_type_set(MY_CLASS_NAME_LEGACY),
|
2014-06-10 19:07:15 -07:00
|
|
|
evas_obj_smart_callbacks_descriptions_set(_smart_callbacks),
|
|
|
|
elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_LIST));
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_diskselector_round_enabled_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-21 08:27:17 -07:00
|
|
|
return sd->round;
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_diskselector_round_enabled_set(Eo *obj, Elm_Diskselector_Data *sd, Eina_Bool enabled)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2011-04-06 21:54:55 -07:00
|
|
|
Eina_List *elist;
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it;
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
Evas_Object *blank;
|
2011-04-06 21:54:55 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (sd->round == enabled)
|
2010-10-07 11:44:43 -07:00
|
|
|
return;
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->round = !!enabled;
|
2012-03-07 04:30:00 -08:00
|
|
|
if (enabled)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->r_items = eina_list_clone(sd->items);
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
_blank_item_check(obj, DISPLAY_ITEM_NUM_MIN);
|
|
|
|
|
|
|
|
/* left blank */
|
|
|
|
EINA_LIST_FOREACH (sd->left_blanks, elist, blank)
|
|
|
|
{
|
|
|
|
elm_box_unpack(sd->main_box, blank);
|
|
|
|
evas_object_hide(blank);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* right blank */
|
|
|
|
EINA_LIST_FOREACH (sd->right_blanks, elist, blank)
|
|
|
|
{
|
|
|
|
elm_box_unpack(sd->main_box, blank);
|
|
|
|
evas_object_hide(blank);
|
|
|
|
}
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (!sd->items)
|
2010-10-07 11:44:43 -07:00
|
|
|
return;
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
_round_items_add(sd);
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (sd->last)
|
|
|
|
elm_box_pack_start(sd->main_box, sd->VIEW(last));
|
|
|
|
if (sd->s_last)
|
|
|
|
elm_box_pack_start(sd->main_box, sd->VIEW(s_last));
|
2011-04-06 21:54:55 -07:00
|
|
|
|
|
|
|
// if more than 3 items should be displayed
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(sd->under_items, elist, it)
|
2012-07-17 15:09:07 -07:00
|
|
|
elm_box_pack_start(sd->main_box, VIEW(it));
|
2011-04-06 21:54:55 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (sd->first)
|
|
|
|
elm_box_pack_end(sd->main_box, sd->VIEW(first));
|
|
|
|
if (sd->second)
|
|
|
|
elm_box_pack_end(sd->main_box, sd->VIEW(second));
|
2011-04-06 21:54:55 -07:00
|
|
|
|
|
|
|
// if more than 3 items should be displayed
|
2012-10-01 00:36:27 -07:00
|
|
|
EINA_LIST_FOREACH(sd->over_items, elist, it)
|
2012-07-17 15:09:07 -07:00
|
|
|
elm_box_pack_end(sd->main_box, VIEW(it));
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
_round_items_del(sd);
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
|
|
|
|
/* left blank */
|
|
|
|
EINA_LIST_FOREACH (sd->left_blanks, elist, blank)
|
|
|
|
{
|
|
|
|
elm_box_pack_start(sd->main_box, blank);
|
|
|
|
evas_object_show(blank);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* right blank */
|
|
|
|
EINA_LIST_FOREACH (sd->right_blanks, elist, blank)
|
|
|
|
{
|
|
|
|
elm_box_pack_end(sd->main_box, blank);
|
|
|
|
evas_object_show(blank);
|
|
|
|
}
|
|
|
|
|
|
|
|
_blank_item_check(obj, sd->display_item_num);
|
|
|
|
|
2013-04-10 04:28:22 -07:00
|
|
|
sd->r_items = eina_list_free(sd->r_items);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
2011-04-06 21:54:55 -07:00
|
|
|
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
if (sd->selected_item) _selected_item_indicate(sd->selected_item);
|
2010-10-07 11:44:43 -07:00
|
|
|
_sizing_eval(obj);
|
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static int
|
|
|
|
_elm_diskselector_side_text_max_length_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2014-03-21 08:27:17 -07:00
|
|
|
return sd->len_side;
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_diskselector_side_text_max_length_set(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd, int len)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->len_side = len;
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-07-17 15:09:07 -07:00
|
|
|
elm_diskselector_bounce_set(Evas_Object *obj,
|
|
|
|
Eina_Bool h_bounce,
|
|
|
|
Eina_Bool v_bounce)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
ELM_DISKSELECTOR_CHECK(obj);
|
|
|
|
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do(obj, elm_interface_scrollable_bounce_allow_set(h_bounce, v_bounce));
|
2010-11-04 17:45:59 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-07-17 15:09:07 -07:00
|
|
|
elm_diskselector_bounce_get(const Evas_Object *obj,
|
|
|
|
Eina_Bool *h_bounce,
|
|
|
|
Eina_Bool *v_bounce)
|
2010-11-04 17:45:59 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
ELM_DISKSELECTOR_CHECK(obj);
|
|
|
|
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do((Eo *) obj, elm_interface_scrollable_bounce_allow_get(h_bounce, v_bounce));
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-07-17 15:09:07 -07:00
|
|
|
elm_diskselector_scroller_policy_get(const Evas_Object *obj,
|
|
|
|
Elm_Scroller_Policy *policy_h,
|
|
|
|
Elm_Scroller_Policy *policy_v)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
|
|
|
ELM_DISKSELECTOR_CHECK(obj);
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do((Eo *) obj, elm_interface_scrollable_policy_get(policy_h, policy_v));
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_diskselector_elm_interface_scrollable_policy_get(Eo *obj, Elm_Diskselector_Data *sd EINA_UNUSED, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
Elm_Scroller_Policy s_policy_h, s_policy_v;
|
|
|
|
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do_super((Eo *)obj, MY_CLASS, elm_interface_scrollable_policy_get(&s_policy_h, &s_policy_v));
|
2012-07-17 15:09:07 -07:00
|
|
|
if (policy_h) *policy_h = (Elm_Scroller_Policy)s_policy_h;
|
|
|
|
if (policy_v) *policy_v = (Elm_Scroller_Policy)s_policy_v;
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-07-17 15:09:07 -07:00
|
|
|
elm_diskselector_scroller_policy_set(Evas_Object *obj,
|
|
|
|
Elm_Scroller_Policy policy_h,
|
|
|
|
Elm_Scroller_Policy policy_v)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
ELM_DISKSELECTOR_CHECK(obj);
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do(obj, elm_interface_scrollable_policy_set(policy_h, policy_v));
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_diskselector_elm_interface_scrollable_policy_set(Eo *obj, Elm_Diskselector_Data *sd EINA_UNUSED, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2011-08-29 09:30:14 -07:00
|
|
|
if ((policy_h >= ELM_SCROLLER_POLICY_LAST) ||
|
|
|
|
(policy_v >= ELM_SCROLLER_POLICY_LAST))
|
|
|
|
return;
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2014-03-17 04:44:40 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, elm_interface_scrollable_policy_set(policy_h, policy_v));
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_diskselector_clear(Eo *obj, Elm_Diskselector_Data *sd)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it;
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (!sd->items) return;
|
2010-10-07 11:44:43 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->selected_item = NULL;
|
2013-03-08 20:23:42 -08:00
|
|
|
EINA_LIST_FREE(sd->items, it)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
2014-08-19 00:52:24 -07:00
|
|
|
eo_del(EO_OBJ(it));
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
_round_items_del(sd);
|
2012-08-28 13:20:28 -07:00
|
|
|
sd->r_items = eina_list_free(sd->r_items);
|
2010-10-07 11:44:43 -07:00
|
|
|
_sizing_eval(obj);
|
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static const Eina_List*
|
|
|
|
_elm_diskselector_items_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-21 08:27:17 -07:00
|
|
|
return sd->items;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static Elm_Object_Item*
|
|
|
|
_elm_diskselector_item_append(Eo *obj, Elm_Diskselector_Data *sd, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it, *dit;
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
Eina_List *elist;
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2013-01-22 02:48:56 -08:00
|
|
|
Evas *evas;
|
|
|
|
|
|
|
|
evas = evas_object_evas_get(obj);
|
|
|
|
evas_event_freeze(evas);
|
2010-10-07 11:44:43 -07:00
|
|
|
|
|
|
|
it = _item_new(obj, icon, label, func, data);
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->items = eina_list_append(sd->items, it);
|
|
|
|
it->node = eina_list_last(sd->items);
|
|
|
|
sd->item_count++;
|
|
|
|
if (sd->round)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
_round_items_del(sd);
|
|
|
|
sd->r_items = eina_list_append(sd->r_items, it);
|
|
|
|
_round_items_add(sd);
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (sd->last)
|
|
|
|
elm_box_pack_start(sd->main_box, sd->VIEW(last));
|
|
|
|
if (sd->s_last)
|
|
|
|
elm_box_pack_start(sd->main_box, sd->VIEW(s_last));
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
|
|
|
|
// if more than 3 items should be displayed
|
|
|
|
EINA_LIST_FOREACH (sd->under_items, elist, dit)
|
|
|
|
elm_box_pack_start(sd->main_box, VIEW(dit));
|
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
elm_box_pack_end(sd->main_box, VIEW(it));
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
|
2012-07-17 15:09:07 -07:00
|
|
|
if (sd->first)
|
|
|
|
elm_box_pack_end(sd->main_box, sd->VIEW(first));
|
|
|
|
if (sd->second)
|
|
|
|
elm_box_pack_end(sd->main_box, sd->VIEW(second));
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
|
|
|
|
// if more than 3 items should be displayed
|
|
|
|
EINA_LIST_FOREACH (sd->over_items, elist, dit)
|
|
|
|
elm_box_pack_end(sd->main_box, VIEW(dit));
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
Evas_Object *blank;
|
|
|
|
blank = eina_list_data_get(sd->right_blanks);
|
|
|
|
elm_box_pack_before(sd->main_box, VIEW(it), blank);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
|
|
|
|
if (!sd->selected_item)
|
|
|
|
sd->selected_item = it;
|
|
|
|
|
2013-01-22 02:49:00 -08:00
|
|
|
if (!sd->scroller_move_idle_enterer)
|
|
|
|
sd->scroller_move_idle_enterer = ecore_idle_enterer_before_add(_scroller_move, obj);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2010-10-07 11:44:43 -07:00
|
|
|
_sizing_eval(obj);
|
2013-01-22 02:48:56 -08:00
|
|
|
|
|
|
|
evas_event_thaw(evas);
|
|
|
|
evas_event_thaw_eval(evas);
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
return EO_OBJ(it);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static Elm_Object_Item*
|
|
|
|
_elm_diskselector_selected_item_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
|
2010-10-07 11:44:43 -07:00
|
|
|
{
|
2014-09-27 22:16:04 -07:00
|
|
|
return EO_OBJ(sd->selected_item);
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_diskselector_item_selected_set(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
|
|
|
|
Eina_Bool selected)
|
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it);
|
2013-09-02 19:38:45 -07:00
|
|
|
ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd);
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2013-09-02 19:38:45 -07:00
|
|
|
if ((sd->selected_item == it) && (selected))
|
2010-11-09 12:27:32 -08:00
|
|
|
return;
|
|
|
|
|
2013-09-02 19:38:45 -07:00
|
|
|
if ((sd->selected_item == it) && (!selected))
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->selected_item = eina_list_data_get(sd->items);
|
2010-11-09 12:27:32 -08:00
|
|
|
else
|
2011-04-06 21:54:55 -07:00
|
|
|
{
|
2013-09-02 19:38:45 -07:00
|
|
|
sd->selected_item = it;
|
2012-07-17 15:09:07 -07:00
|
|
|
_selected_item_indicate(sd->selected_item);
|
2011-04-06 21:54:55 -07:00
|
|
|
}
|
2010-11-09 12:27:32 -08:00
|
|
|
|
2013-01-22 02:49:00 -08:00
|
|
|
if (!sd->scroller_move_idle_enterer)
|
2014-09-27 22:16:04 -07:00
|
|
|
sd->scroller_move_idle_enterer = ecore_idle_enterer_before_add(_scroller_move, WIDGET(it));
|
2010-10-07 11:44:43 -07:00
|
|
|
}
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_diskselector_item_selected_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it)
|
2010-11-09 12:27:32 -08:00
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
|
|
|
|
ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd);
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
return sd->selected_item == it;
|
2010-11-09 12:27:32 -08:00
|
|
|
}
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
EOLIAN static Elm_Object_Item *
|
|
|
|
_elm_diskselector_item_prev_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it)
|
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL);
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *prev_it = NULL;
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
if (it->node->prev) prev_it = it->node->prev->data;
|
|
|
|
if (prev_it) return EO_OBJ(prev_it);
|
2010-10-07 11:44:43 -07:00
|
|
|
else return NULL;
|
|
|
|
}
|
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
EOLIAN static Elm_Object_Item *
|
|
|
|
_elm_diskselector_item_next_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it)
|
|
|
|
{
|
2012-07-17 15:09:07 -07:00
|
|
|
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL);
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *next_it = NULL;
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2014-09-27 22:16:04 -07:00
|
|
|
if (it->node->next) next_it = it->node->next->data;
|
|
|
|
if (next_it) return EO_OBJ(next_it);
|
2010-10-07 11:44:43 -07:00
|
|
|
else return NULL;
|
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static Elm_Object_Item*
|
|
|
|
_elm_diskselector_first_item_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
|
2010-11-09 12:27:32 -08:00
|
|
|
{
|
2014-03-21 08:27:17 -07:00
|
|
|
if (!sd || !sd->items) return NULL;
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it = eina_list_data_get(sd->items);
|
|
|
|
if (it) return EO_OBJ(it);
|
|
|
|
else return NULL;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static Elm_Object_Item*
|
|
|
|
_elm_diskselector_last_item_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-21 08:27:17 -07:00
|
|
|
if (!sd->items) return NULL;
|
2014-09-27 22:16:04 -07:00
|
|
|
Elm_Diskselector_Item_Data *it = eina_list_data_get(eina_list_last(sd->items));
|
|
|
|
if (it) return EO_OBJ(it);
|
|
|
|
else return NULL;
|
2010-11-09 12:27:32 -08:00
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_diskselector_display_item_num_set(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd, int num)
|
2011-04-06 21:54:55 -07:00
|
|
|
{
|
|
|
|
if (num < DISPLAY_ITEM_NUM_MIN) num = DISPLAY_ITEM_NUM_MIN;
|
2012-07-17 15:09:07 -07:00
|
|
|
sd->display_item_num = num;
|
|
|
|
sd->display_item_num_by_api = EINA_TRUE;
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] diskselector - bug fix
diskselector has two bugs.
1. on round enable mode
elm_diskselector_item_append(); does not call elm_box_pack_*() for
over_items and under_items which are added when the display item is
bigger
than 3.
because over_items and under_items is not added, the diskselector shows
just 4 items + half item(NOT 5 items), in case of display item number
is 5
- elm_diskselector_display_item_num(obj, 5); -.
this bug could be found only if u use as following sequence.
a. elm_diskselector_round_enabled_set(obj, EINA_TRUE);
b. elm_diskselector_item_append();
2. on the round disable mode + bigger than 3 display item
even though display item is bigger than 3 on the round disable
mode, only
two blank items are added - left_blank, right_blank.
because of this, the first item could not be selected. means.. the first
item cannot be located in the middle of diskselector.
if u scroll the diskselector to the left-most, then the second item is
selected as below.
[blank] [ 1st ] [ 2nd ] [ 3rd ] [ 4th ]
so if the display item is bigger than 3, more blank items would be
necessary.
include lines to resolve above 1st bug, the patch would resolve
this issue
also.
SVN revision: 77740
2012-10-10 02:43:58 -07:00
|
|
|
|
|
|
|
if (!sd->round) _blank_item_check(obj, num);
|
2011-04-06 21:54:55 -07:00
|
|
|
}
|
2011-09-02 22:13:25 -07:00
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
EOLIAN static int
|
|
|
|
_elm_diskselector_display_item_num_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
|
2011-09-02 22:13:25 -07:00
|
|
|
{
|
2014-03-21 08:27:17 -07:00
|
|
|
return sd->display_item_num;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-07-17 15:09:07 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
2014-03-21 08:27:17 -07:00
|
|
|
_elm_diskselector_class_constructor(Eo_Class *klass)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2013-11-07 03:44:22 -08:00
|
|
|
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
2013-02-09 23:52:31 -08:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
|
|
|
|
_elm_diskselector_smart_focus_next_enable = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2014-07-25 01:33:19 -07:00
|
|
|
EOLIAN static const Elm_Atspi_Action*
|
|
|
|
_elm_diskselector_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
static Elm_Atspi_Action atspi_actions[] = {
|
|
|
|
{ "move,previous", "move", "prev", _key_action_move},
|
|
|
|
{ "move,next", "move", "next", _key_action_move},
|
|
|
|
{ "move,first", "move", "first", _key_action_move},
|
|
|
|
{ "move,last", "move", "last", _key_action_move},
|
|
|
|
{ NULL, NULL, NULL, NULL }
|
|
|
|
};
|
|
|
|
return &atspi_actions[0];
|
|
|
|
}
|
|
|
|
|
2014-03-21 08:27:17 -07:00
|
|
|
#include "elm_diskselector.eo.c"
|
2014-09-27 22:16:04 -07:00
|
|
|
#include "elm_diskselector_item.eo.c"
|