run_program(PROGRAM:"expand");
}
}
+ program { name: "switch";
+ signal: "elm,action,switch";
+ source: "elm";
+ script {
+ new st[31];
+ new Float:vl;
+ get_state(PART:"elm.swallow.content", st, 30, vl);
+ if (!strcmp(st, "default"))
+ set_state(PART:"elm.swallow.content", "collapsed", 0.0);
+ else
+ set_state(PART:"elm.swallow.content", "default", 0.0);
+ }
+ }
program { name: "signal";
action: SIGNAL_EMIT "elm,anim,done" "elm";
}
if (!wd) return;
enable = !!enable;
if (wd->collapsed == enable) return;
+ edje_object_signal_emit(wd->frm, "elm,action,switch", "elm");
+ edje_object_message_signal_process(wd->frm);
+ wd->collapsed = enable;
+ wd->anim = EINA_FALSE;
+ _sizing_eval(obj);
+}
+
+EAPI void
+elm_frame_collapse_go(Evas_Object *obj, Eina_Bool enable)
+{
+ Widget_Data *wd;
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ enable = !!enable;
+ if (wd->collapsed == enable) return;
edje_object_signal_emit(wd->frm, "elm,action,toggle", "elm");
evas_object_smart_callback_add(wd->frm, "recalc", (Evas_Smart_Cb)_recalc, obj);
wd->collapsed = enable;
EAPI Eina_Bool elm_frame_autocollapse_get(Evas_Object *obj);
/**
- * @brief Manually collapse a frame
+ * @brief Manually collapse a frame without animations
* @param obj The frame
* @param enable true to collapse, false to expand
*
- * Use this to toggle the collapsed state of a frame.
+ * Use this to toggle the collapsed state of a frame, bypassing animations.
*/
EAPI void elm_frame_collapse_set(Evas_Object *obj, Eina_Bool enable);
/**
+ * @brief Manually collapse a frame with animations
+ * @param obj The frame
+ * @param enable true to collapse, false to expand
+ *
+ * Use this to toggle the collapsed state of a frame, triggering animations.
+ */
+EAPI void elm_frame_collapse_go(Evas_Object *obj, Eina_Bool enable);
+
+/**
* @brief Determine the collapse state of a frame
* @param obj The frame
* @return true if collapsed, false otherwise