forked from enlightenment/efl
(remove useless edje_object_scale_sets's on objects that are not edje objects)
but more importantly - fix list to actually have a specific theme/base for it SVN revision: 47381
This commit is contained in:
parent
8ef9ff019e
commit
9705f7dbe1
|
@ -423,6 +423,7 @@ extern "C" {
|
|||
|
||||
EAPI Evas_Object *elm_scroller_add(Evas_Object *parent);
|
||||
EAPI void elm_scroller_content_set(Evas_Object *obj, Evas_Object *child);
|
||||
EAPI void elm_scroller_custom_widget_base_theme_set(Evas_Object *obj, const char *widget, const char *base);
|
||||
EAPI void elm_scroller_content_min_limit(Evas_Object *obj, Eina_Bool w, Eina_Bool h);
|
||||
EAPI void elm_scroller_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
|
||||
EAPI void elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v);
|
||||
|
|
|
@ -371,7 +371,7 @@ _theme_hook(Evas_Object *obj)
|
|||
Item_Block *itb;
|
||||
if (!wd) return;
|
||||
elm_smart_scroller_theme_set(wd->scr, "genlist", "base", elm_widget_style_get(obj));
|
||||
edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
EINA_INLIST_FOREACH(wd->blocks, itb)
|
||||
{
|
||||
Eina_List *l;
|
||||
|
|
|
@ -200,8 +200,9 @@ _theme_hook(Evas_Object *obj)
|
|||
if (!wd) return;
|
||||
if (wd->scr)
|
||||
{
|
||||
elm_smart_scroller_theme_set(wd->scr, "list", "base", elm_widget_style_get(obj));
|
||||
edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
elm_scroller_custom_widget_base_theme_set(wd->scr, "list", "base");
|
||||
elm_object_style_set(wd->scr, elm_widget_style_get(obj));
|
||||
// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
}
|
||||
EINA_LIST_FOREACH(wd->items, n, it)
|
||||
{
|
||||
|
@ -709,6 +710,7 @@ elm_list_add(Evas_Object *parent)
|
|||
elm_widget_can_focus_set(obj, 1);
|
||||
|
||||
wd->scr = elm_scroller_add(parent);
|
||||
elm_scroller_custom_widget_base_theme_set(wd->scr, "list", "base");
|
||||
elm_widget_resize_object_set(obj, wd->scr);
|
||||
|
||||
elm_scroller_bounce_set(wd->scr, 0, 1);
|
||||
|
|
|
@ -1107,7 +1107,7 @@ _theme_hook(Evas_Object *obj)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
elm_smart_scroller_theme_set(wd->scr, "map", "base", elm_widget_style_get(obj));
|
||||
edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ _theme_hook(Evas_Object *obj)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
int scale = 0;
|
||||
if (!wd) return;
|
||||
scale = (elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
edje_object_scale_set(wd->scr, scale);
|
||||
// scale = (elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
// edje_object_scale_set(wd->scr, scale);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -710,7 +710,7 @@ _theme_hook(Evas_Object *obj)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
elm_smart_scroller_theme_set(wd->scr, "photocam", "base", elm_widget_style_get(obj));
|
||||
edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ struct _Widget_Data
|
|||
{
|
||||
Evas_Object *scr;
|
||||
Evas_Object *content;
|
||||
const char *widget_name, *widget_base;
|
||||
Eina_Bool min_w : 1;
|
||||
Eina_Bool min_h : 1;
|
||||
double pagerel_h, pagerel_v;
|
||||
|
@ -61,13 +62,16 @@ _del_hook(Evas_Object *obj)
|
|||
static void
|
||||
_theme_hook(Evas_Object *obj)
|
||||
{
|
||||
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->scr)
|
||||
{
|
||||
elm_smart_scroller_theme_set(wd->scr, "scroller", "base", elm_widget_style_get(obj));
|
||||
edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
// elm_smart_scroller_theme_set(wd->scr, "scroller", "base", elm_widget_style_get(obj));
|
||||
elm_smart_scroller_theme_set(wd->scr,
|
||||
wd->widget_name,
|
||||
wd->widget_base,
|
||||
elm_widget_style_get(obj));
|
||||
// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -277,7 +281,14 @@ elm_scroller_add(Evas_Object *parent)
|
|||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
|
||||
wd->widget_name = eina_stringshare_add("scroller");
|
||||
wd->widget_base = eina_stringshare_add("base");
|
||||
|
||||
wd->scr = elm_smart_scroller_add(e);
|
||||
// elm_smart_scroller_theme_set(wd->scr,
|
||||
// wd->widget_name,
|
||||
// wd->widget_base,
|
||||
// elm_widget_style_get(obj));
|
||||
elm_widget_resize_object_set(obj, wd->scr);
|
||||
evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
|
@ -310,7 +321,7 @@ elm_scroller_add(Evas_Object *parent)
|
|||
/**
|
||||
* Set the content object
|
||||
*
|
||||
* XXX
|
||||
* Sets the content of the scroller (the object to be scrolled around)
|
||||
*
|
||||
* @param obj The scroller object
|
||||
* @param content The new content object
|
||||
|
@ -338,6 +349,25 @@ elm_scroller_content_set(Evas_Object *obj, Evas_Object *content)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set custom theme elements for the scroller
|
||||
*
|
||||
* @param obj The scroller object
|
||||
* @param widget The widget name to use (default is "scroller")
|
||||
* @param base The base name to use (default is "base")
|
||||
*/
|
||||
EAPI void
|
||||
elm_scroller_custom_widget_base_theme_set(Evas_Object *obj, const char *widget, const char *base)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if ((!widget) || (!base)) return;
|
||||
if (eina_stringshare_replace(&wd->widget_name, widget) |
|
||||
eina_stringshare_replace(&wd->widget_base, base))
|
||||
_theme_hook(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make the scroller minimum size limited to the minimum size of the content
|
||||
*
|
||||
|
|
|
@ -174,7 +174,7 @@ _theme_hook(Evas_Object *obj)
|
|||
|
||||
if (!wd) return;
|
||||
scale = (elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
edje_object_scale_set(wd->scr, scale);
|
||||
// edje_object_scale_set(wd->scr, scale);
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
{
|
||||
Evas_Coord mw, mh;
|
||||
|
|
Loading…
Reference in New Issue