forked from enlightenment/efl
Scroller now checks if its theme has a highlight for focus, and if so, sets the necessary flags for it to work.
Also, a not really nice highlight for the scroller theme, but I am no artists and it shows the feature working. SVN revision: 52650
This commit is contained in:
parent
ae44befb75
commit
c9a4a09aaa
|
@ -216,6 +216,10 @@ collections {
|
|||
alias: "elm/carousel/base/default";
|
||||
alias: "elm/gengrid/base/default";
|
||||
|
||||
data {
|
||||
item: "focus_highlight" "on";
|
||||
}
|
||||
|
||||
script {
|
||||
public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer;
|
||||
public timer0(val) {
|
||||
|
@ -245,6 +249,7 @@ collections {
|
|||
image: "bt_sm_base2.png" COMP;
|
||||
image: "bt_sm_shine.png" COMP;
|
||||
image: "bt_sm_hilight.png" COMP;
|
||||
image: "sl_bt2_2.png" COMP;
|
||||
image: "sb_runnerh.png" COMP;
|
||||
image: "sb_runnerv.png" COMP;
|
||||
}
|
||||
|
@ -289,7 +294,29 @@ collections {
|
|||
}
|
||||
fill.smooth : 0;
|
||||
}
|
||||
}
|
||||
description { state: "enabled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 200 155 0 255;
|
||||
}
|
||||
}
|
||||
part { name: "focus_highlight";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
rel1.offset: -1 -1;
|
||||
rel2.offset: 0 0;
|
||||
image {
|
||||
normal: "sl_bt2_2.png";
|
||||
border: 7 7 7 7;
|
||||
middle: 0;
|
||||
}
|
||||
fill.smooth : 0;
|
||||
color: 200 155 0 0;
|
||||
}
|
||||
description { state: "enabled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 200 155 0 255;
|
||||
}
|
||||
}
|
||||
part { name: "sb_vbar_clip_master";
|
||||
type: RECT;
|
||||
mouse_events: 0;
|
||||
|
@ -662,6 +689,23 @@ collections {
|
|||
set_int(sbvis_timer, v);
|
||||
}
|
||||
}
|
||||
|
||||
program { name: "highlight_show";
|
||||
signal: "elm,action,focus_highlight,show";
|
||||
source: "elm";
|
||||
action: STATE_SET "enabled" 0.0;
|
||||
transition: ACCELERATE 0.3;
|
||||
target: "focus_highlight";
|
||||
target: "conf_over";
|
||||
}
|
||||
program { name: "highlight_hide";
|
||||
signal: "elm,action,focus_highlight,hide";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: DECELERATE 0.3;
|
||||
target: "focus_highlight";
|
||||
target: "conf_over";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -87,10 +87,19 @@ _theme_hook(Evas_Object *obj)
|
|||
if (!wd) return;
|
||||
if (wd->scr)
|
||||
{
|
||||
Evas_Object *edj;
|
||||
const char *str;
|
||||
|
||||
elm_smart_scroller_object_theme_set(obj, 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);
|
||||
edj = elm_smart_scroller_edje_object_get(wd->scr);
|
||||
str = edje_object_data_get(edj, "focus_highlight");
|
||||
if (str && !strcmp(str, "on"))
|
||||
elm_widget_highlight_in_theme_set(obj, EINA_TRUE);
|
||||
else
|
||||
elm_widget_highlight_in_theme_set(obj, EINA_FALSE);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -336,9 +345,7 @@ elm_scroller_add(Evas_Object *parent)
|
|||
|
||||
wd->scr = elm_smart_scroller_add(e);
|
||||
elm_smart_scroller_widget_set(wd->scr, obj);
|
||||
elm_smart_scroller_object_theme_set(obj, wd->scr,
|
||||
wd->widget_name, wd->widget_base,
|
||||
elm_widget_style_get(obj));
|
||||
_theme_hook(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);
|
||||
|
|
Loading…
Reference in New Issue