#define DISABLE 4
script {
public btmode;
+ public vertical = 0;
+ public scroll = 0;
public eval_mode(m) {
new m1 = m & MASK;
new d = m & DISABLE;
}
}
}
+
+ public enable_scroll() {
+ set_int(scroll, 1);
+
+ if (get_int(vertical))
+ set_state(PART:"base", "vert_scroll", 0.0);
+ else
+ set_state(PART:"base", "scroll", 0.0);
+ }
+
+ public disable_scroll() {
+ set_int(scroll, 0);
+
+ if (get_int(vertical))
+ set_state(PART:"base", "vert", 0.0);
+ else
+ set_state(PART:"base", "default", 0.0);
+ }
+
+ public enable_vertical() {
+ set_int(vertical, 1);
+
+ if (get_int(scroll))
+ set_state(PART:"base", "vert_scroll", 0.0);
+ else
+ set_state(PART:"base", "vert", 0.0);
+ set_state(PART:"bend_clip", "vert", 0.0);
+ }
+
+ public disable_vertical() {
+ set_int(vertical, 0);
+
+ if (get_int(scroll))
+ set_state(PART:"base", "scroll", 0.0);
+ else
+ set_state(PART:"base", "default", 0.0);
+ set_state(PART:"bend_clip", "default", 0.0);
+ }
}
parts {
part { name: "base"; type: SPACER;
rel1.offset: -1 0;
rel2.offset: 0 -1;
}
+ description { state: "scroll" 0.0;
+ inherit: "default" 0.0;
+ min: 80 0;
+ }
+ description { state: "vert_scroll" 0.0;
+ inherit: "vert" 0.0;
+ min: 0 80;
+ }
}
part { name: "shadow1"; mouse_events: 0;
description { state: "default" 0.0;
programs {
program {
signal: "elm,orient,horizontal"; source: "elm";
- action: STATE_SET "default" 0.0;
- target: "base";
- target: "bend_clip";
+ script {
+ disable_vertical();
+ }
}
program {
signal: "elm,orient,vertical"; source: "elm";
- action: STATE_SET "vert" 0.0;
- target: "base";
- target: "bend_clip";
+ script {
+ enable_vertical();
+ }
+ }
+ program {
+ signal: "elm,state,shrink,scroll"; source: "elm";
+ script {
+ enable_scroll();
+ }
+ }
+ program {
+ signal: "elm,state,shrink,none"; source: "elm";
+ script {
+ disable_scroll()
+ }
+ }
+ program {
+ signal: "elm,state,shrink,hide"; source: "elm";
+ script {
+ disable_scroll()
+ }
+ }
+ program {
+ signal: "elm,state,shrink,menu"; source: "elm";
+ script {
+ disable_scroll()
+ }
+ }
+ program {
+ signal: "elm,state,shrink,expand"; source: "elm";
+ script {
+ disable_scroll()
+ }
}
program { name: "st0";
}
static void
+_item_shrink_signal_emit(Evas_Object *view, Elm_Toolbar_Shrink_Mode shrink_mode)
+{
+ switch (shrink_mode)
+ {
+ case ELM_TOOLBAR_SHRINK_HIDE:
+ elm_layout_signal_emit(view, "elm,state,shrink,hide", "elm");
+ break;
+ case ELM_TOOLBAR_SHRINK_SCROLL:
+ elm_layout_signal_emit(view, "elm,state,shrink,scroll", "elm");
+ break;
+ case ELM_TOOLBAR_SHRINK_MENU:
+ elm_layout_signal_emit(view, "elm,state,shrink,menu", "elm");
+ break;
+ case ELM_TOOLBAR_SHRINK_EXPAND:
+ elm_layout_signal_emit(view, "elm,state,shrink,expand", "elm");
+ break;
+ case ELM_TOOLBAR_SHRINK_NONE:
+ case ELM_TOOLBAR_SHRINK_LAST:
+ default:
+ elm_layout_signal_emit(view, "elm,state,shrink,default", "elm");
+ break;
+ }
+}
+
+static void
_item_theme_hook(Evas_Object *obj,
Elm_Toolbar_Item_Data *it,
double scale,
}
}
+ _item_shrink_signal_emit(view, sd->shrink_mode);
+
if (sd->vertical)
elm_layout_signal_emit(view, "elm,orient,vertical", "elm");
else
EOLIAN static void
_elm_toolbar_shrink_mode_set(Eo *obj, Elm_Toolbar_Data *sd, Elm_Toolbar_Shrink_Mode shrink_mode)
{
+ Elm_Toolbar_Item_Data *it;
Eina_Bool bounce;
if (sd->shrink_mode == shrink_mode) return;
eo_do(obj, elm_interface_scrollable_policy_set
(ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF));
+ EINA_INLIST_FOREACH(sd->items, it)
+ _item_shrink_signal_emit(VIEW(it), sd->shrink_mode);
+
evas_object_smart_need_recalculate_set(obj, EINA_TRUE);
}
aggregate items which didn't fit with the #ELM_TOOLBAR_SHRINK_MENU
mode.
+ If shrink mode is changed, Toolbar will send one of the following
+ signal to each item for informing the current shrink mode.
+ "elm,state,shrink,default"
+ "elm,state,shrink,hide"
+ "elm,state,shrink,scroll"
+ "elm,state,shrink,menu"
+ "elm,state,shrink,expand"
+
Warning: This function's behavior will clash with those of
elm_scroller_policy_set(), so use either one of them, but not both.]]
set {