///////////////////////////////////////////////////////////////////////////////
group { name: "elm/scroller/base/default";
script {
- public sbvis_v, sbvis_h, sbvis_timer;
+ public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer;
public timer0(val) {
new v;
v = get_int(sbvis_v);
if (v) {
- emit("do-hide-vbar", "");
- set_int(sbvis_v, 0);
+ v = get_int(sbalways_v);
+ if (!v) {
+ emit("do-hide-vbar", "");
+ set_int(sbvis_v, 0);
+ }
}
v = get_int(sbvis_h);
if (v) {
- emit("do-hide-hbar", "");
- set_int(sbvis_h, 0);
+ v = get_int(sbalways_h);
+ if (!v) {
+ emit("do-hide-hbar", "");
+ set_int(sbvis_h, 0);
+ }
}
set_int(sbvis_timer, 0);
return 0;
fill.smooth : 0;
}
}
+ part { name: "sb_vbar_clip_master";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ }
+ description { state: "hidden" 0.0;
+ visible: 0;
+ color: 255 255 255 0;
+ }
+ }
part { name: "sb_vbar_clip";
+ clip_to: "sb_vbar_clip_master";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
}
}
+ part { name: "sb_hbar_clip_master";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ }
+ description { state: "hidden" 0.0;
+ visible: 0;
+ color: 255 255 255 0;
+ }
+ }
part { name: "sb_hbar_clip";
+ clip_to: "sb_hbar_clip_master";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
set_state(PART:"sb_vbar_clip", "hidden", 0.0);
set_int(sbvis_h, 0);
set_int(sbvis_v, 0);
+ set_int(sbalways_v, 0);
+ set_int(sbalways_h, 0);
set_int(sbvis_timer, 0);
}
}
-/*
+
program { name: "vbar_show";
signal: "elm,action,show,vbar";
source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "sb_vbar_clip_master";
}
program { name: "vbar_hide";
signal: "elm,action,hide,vbar";
source: "elm";
+ action: STATE_SET "hidden" 0.0;
+ target: "sb_vbar_clip_master";
}
- program { name: "hbar_show";
- signal: "elm,action,show,hbar";
+ program { name: "vbar_show_always";
+ signal: "elm,action,show_always,vbar";
source: "elm";
+ script {
+ new v;
+ v = get_int(sbvis_v);
+ v |= get_int(sbalways_v);
+ if (!v) {
+ set_int(sbalways_v, 1);
+ emit("do-show-vbar", "");
+ set_int(sbvis_v, 1);
+ }
+ }
}
- program { name: "hbar_hide";
- signal: "elm,action,hide,hbar";
+ program { name: "vbar_show_notalways";
+ signal: "elm,action,show_notalways,vbar";
source: "elm";
+ script {
+ new v;
+ v = get_int(sbalways_v);
+ if (v) {
+ set_int(sbalways_v, 0);
+ v = get_int(sbvis_v);
+ if (!v) {
+ emit("do-hide-vbar", "");
+ set_int(sbvis_v, 0);
+ }
+ }
+ }
}
- */
program { name: "sb_vbar_show";
signal: "do-show-vbar";
source: "";
transition: LINEAR 1.0;
target: "sb_vbar_clip";
}
+
+ program { name: "hbar_show";
+ signal: "elm,action,show,hbar";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "sb_hbar_clip_master";
+ }
+ program { name: "hbar_hide";
+ signal: "elm,action,hide,hbar";
+ source: "elm";
+ action: STATE_SET "hidden" 0.0;
+ target: "sb_hbar_clip_master";
+ }
+ program { name: "hbar_show_always";
+ signal: "elm,action,show_always,hbar";
+ source: "elm";
+ script {
+ new v;
+ v = get_int(sbvis_h);
+ v |= get_int(sbalways_h);
+ if (!v) {
+ set_int(sbalways_h, 1);
+ emit("do-show-hbar", "");
+ set_int(sbvis_h, 1);
+ }
+ }
+ }
+ program { name: "hbar_show_notalways";
+ signal: "elm,action,show_notalways,hbar";
+ source: "elm";
+ script {
+ new v;
+ v = get_int(sbalways_h);
+ if (v) {
+ set_int(sbalways_h, 0);
+ v = get_int(sbvis_h);
+ if (!v) {
+ emit("do-hide-hbar", "");
+ set_int(sbvis_h, 0);
+ }
+ }
+ }
+ }
program { name: "sb_hbar_show";
signal: "do-show-hbar";
source: "";
transition: LINEAR 1.0;
target: "sb_hbar_clip";
}
+
program { name: "scroll";
signal: "elm,action,scroll";
source: "elm";
- action: STATE_SET "default" 0.0;
script {
new v;
v = get_int(sbvis_v);
+ v |= get_int(sbalways_v);
if (!v) {
- emit("do-show-vbar", "");
- set_int(sbvis_v, 1);
+ emit("do-show-vbar", "");
+ set_int(sbvis_v, 1);
}
v = get_int(sbvis_h);
+ v |= get_int(sbalways_h);
if (!v) {
- emit("do-show-hbar", "");
- set_int(sbvis_h, 1);
+ emit("do-show-hbar", "");
+ set_int(sbvis_h, 1);
}
v = get_int(sbvis_timer);
if (v > 0) cancel_timer(v);
}
}
}
+/*
part { name: "sel";
type: RECT;
mouse_events: 0;
color: 255 0 0 50;
}
}
+ */
}
programs {
program { name: "focus";
action: FOCUS_SET;
target: "elm.text";
}
+/*
program { name: "selmode0";
signal: "elm,state,select,on";
source: "elm";
action: STATE_SET "default" 0.0;
target: "sel";
}
+ */
}
}
sc = elm_scroller_add(win);
elm_scroller_content_min_limit(sc, 0, 1);
+ elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
evas_object_size_hint_weight_set(sc, 1.0, 0.0);
evas_object_size_hint_align_set(sc, -1.0, -1.0);
elm_box_pack_end(bx, sc);
sc = elm_scroller_add(win);
elm_scroller_content_min_limit(sc, 0, 1);
+ elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
evas_object_size_hint_weight_set(sc, 1.0, 0.0);
evas_object_size_hint_align_set(sc, -1.0, -1.0);
elm_box_pack_end(bx, sc);
sc = elm_scroller_add(win);
evas_object_size_hint_weight_set(sc, 1.0, 1.0);
evas_object_size_hint_align_set(sc, -1.0, -1.0);
+ elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON);
elm_box_pack_end(bx, sc);
en = elm_entry_add(win);
/* smart callbacks called:
* "clicked" - the user clicked the button
*/
+
+ typedef enum _Elm_Scroller_Policy
+ {
+ ELM_SCROLLER_POLICY_AUTO,
+ ELM_SCROLLER_POLICY_ON,
+ ELM_SCROLLER_POLICY_OFF
+ }
+ Elm_Scroller_Policy;
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_content_min_limit(Evas_Object *obj, Evas_Bool w, Evas_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);
+ EAPI void elm_scroller_region_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
/* smart callbacks called:
*/
minminw = minw;
edje_object_size_min_restricted_calc(wd->ent, &minw, &minh, resw, 0);
evas_object_size_hint_min_set(data, minminw, minh);
- evas_object_size_hint_max_set(data, minminw, maxh);
+ evas_object_size_hint_max_set(data, -1, maxh);
}
static void
if (!wd) return;
elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
}
+
+EAPI void
+elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ const Elm_Scroller_Policy map[3] =
+ {
+ ELM_SMART_SCROLLER_POLICY_AUTO,
+ ELM_SMART_SCROLLER_POLICY_ON,
+ ELM_SMART_SCROLLER_POLICY_OFF
+ };
+ if (!wd) return;
+ if ((policy_h < 0) || (policy_h >= 3) || (policy_v < 0) || (policy_v >= 3))
+ return;
+ elm_smart_scroller_policy_set(wd->scr, map[policy_h], map[policy_v]);
+}
+
+EAPI void
+elm_scroller_region_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ if ((x) && (y)) elm_smart_scroller_child_pos_get(wd->scr, x, y);
+ if ((w) && (h)) elm_smart_scroller_child_viewport_size_get(wd->scr, w, h);
+}
sd->vbar_visible = !sd->vbar_visible;
sd->hbar_visible = !sd->hbar_visible;
_smart_scrollbar_bar_visibility_adjust(sd);
+ if (sd->hbar_flags == ELM_SMART_SCROLLER_POLICY_ON)
+ edje_object_signal_emit(sd->edje_obj, "elm,action,show_always,hbar", "elm");
+ else if (sd->hbar_flags == ELM_SMART_SCROLLER_POLICY_OFF)
+ edje_object_signal_emit(sd->edje_obj, "elm,action,hide,hbar", "elm");
+ else
+ edje_object_signal_emit(sd->edje_obj, "elm,action,show_notalways,hbar", "elm");
+ if (sd->vbar_flags == ELM_SMART_SCROLLER_POLICY_ON)
+ edje_object_signal_emit(sd->edje_obj, "elm,action,show_always,vbar", "elm");
+ else if (sd->vbar_flags == ELM_SMART_SCROLLER_POLICY_OFF)
+ edje_object_signal_emit(sd->edje_obj, "elm,action,hide,vbar", "elm");
+ else
+ edje_object_signal_emit(sd->edje_obj, "elm,action,show_notalways,vbar", "elm");
}
void
if ((sd->hbar_flags == hbar) && (sd->vbar_flags == vbar)) return;
sd->hbar_flags = hbar;
sd->vbar_flags = vbar;
+ if (sd->hbar_flags == ELM_SMART_SCROLLER_POLICY_ON)
+ edje_object_signal_emit(sd->edje_obj, "elm,action,show_always,hbar", "elm");
+ else if (sd->hbar_flags == ELM_SMART_SCROLLER_POLICY_OFF)
+ edje_object_signal_emit(sd->edje_obj, "elm,action,hide,hbar", "elm");
+ else
+ edje_object_signal_emit(sd->edje_obj, "elm,action,show_notalways,hbar", "elm");
+ if (sd->vbar_flags == ELM_SMART_SCROLLER_POLICY_ON)
+ edje_object_signal_emit(sd->edje_obj, "elm,action,show_always,vbar", "elm");
+ else if (sd->vbar_flags == ELM_SMART_SCROLLER_POLICY_OFF)
+ edje_object_signal_emit(sd->edje_obj, "elm,action,hide,vbar", "elm");
+ else
+ edje_object_signal_emit(sd->edje_obj, "elm,action,show_notalways,vbar", "elm");
_smart_scrollbar_size_adjust(sd);
}
}
if (scroll_v_vis_change)
{
- if (sd->vbar_visible)
- edje_object_signal_emit(sd->edje_obj, "elm,action,show,vbar", "elm");
- else
- edje_object_signal_emit(sd->edje_obj, "elm,action,hide,vbar", "elm");
- edje_object_message_signal_process(sd->edje_obj);
- _smart_scrollbar_size_adjust(sd);
+ if (sd->vbar_flags != ELM_SMART_SCROLLER_POLICY_OFF)
+ {
+ if (sd->vbar_visible)
+ edje_object_signal_emit(sd->edje_obj, "elm,action,show,vbar", "elm");
+ else
+ edje_object_signal_emit(sd->edje_obj, "elm,action,hide,vbar", "elm");
+ edje_object_message_signal_process(sd->edje_obj);
+ _smart_scrollbar_size_adjust(sd);
+ }
+ else
+ edje_object_signal_emit(sd->edje_obj, "elm,action,hide,vbar", "elm");
}
return scroll_v_vis_change;
}
}
if (scroll_h_vis_change)
{
- if (sd->hbar_visible)
- edje_object_signal_emit(sd->edje_obj, "elm,action,show,hbar", "elm");
- else
- edje_object_signal_emit(sd->edje_obj, "elm,action,hide,hbar", "elm");
- edje_object_message_signal_process(sd->edje_obj);
+ if (sd->hbar_flags != ELM_SMART_SCROLLER_POLICY_OFF)
+ {
+ if (sd->hbar_visible)
+ edje_object_signal_emit(sd->edje_obj, "elm,action,show,hbar", "elm");
+ else
+ edje_object_signal_emit(sd->edje_obj, "elm,action,hide,hbar", "elm");
+ edje_object_message_signal_process(sd->edje_obj);
+ _smart_scrollbar_size_adjust(sd);
+ }
+ else
+ edje_object_signal_emit(sd->edje_obj, "elm,action,hide,hbar", "elm");
_smart_scrollbar_size_adjust(sd);
}
return scroll_h_vis_change;