Evas_Object *frm;
Evas_Object *content;
const char *label;
+ Eina_Bool collapsed : 1;
+ Eina_Bool collapsible : 1;
};
static const char SIG_CLICKED[] = "clicked";
wd = elm_widget_data_get(fr);
if (!wd) return;
evas_object_smart_callback_call(fr, SIG_CLICKED, NULL);
+ if (!wd->collapsible) return;
+ edje_object_signal_emit(wd->frm, "elm,action,collapse", "elm");
+ wd->collapsed++;
}
EAPI Evas_Object *
}
EAPI void
+elm_frame_autocollapse_set(Evas_Object *obj, Eina_Bool enable)
+{
+ Widget_Data *wd;
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ wd->collapsible = !!enable;
+}
+
+EAPI Eina_Bool
+elm_frame_autocollapse_get(Evas_Object *obj)
+{
+ Widget_Data *wd;
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+ wd = elm_widget_data_get(obj);
+ if (!wd) return EINA_FALSE;
+ return wd->collapsible;
+}
+
+EAPI void
+elm_frame_collapse_set(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,collapse", "elm");
+ wd->collapsed = enable;
+}
+
+EAPI Eina_Bool
+elm_frame_collapse_get(Evas_Object *obj)
+{
+ Widget_Data *wd;
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+ wd = elm_widget_data_get(obj);
+ if (!wd) return EINA_FALSE;
+ return wd->collapsed;
+}
+
+
+EAPI void
elm_frame_label_set(Evas_Object *obj, const char *label)
{
_elm_frame_label_set(obj, NULL, label);
EAPI Evas_Object *elm_frame_add(Evas_Object *parent);
/**
+ * @brief Toggle autocollapsing of a frame
+ * @param obj The frame
+ * @param enable Whether to enable autocollapse
+ *
+ * When @p enable is EINA_TRUE, clicking a frame's label will collapse the frame
+ * vertically, shrinking it to the height of the label.
+ * By default, this is DISABLED.
+ */
+EAPI void elm_frame_autocollapse_set(Evas_Object *obj, Eina_Bool enable);
+
+/**
+ * @brief Determine autocollapsing of a frame
+ * @param obj The frame
+ * @return Whether autocollapse is enabled
+ *
+ * When this returns EINA_TRUE, clicking a frame's label will collapse the frame
+ * vertically, shrinking it to the height of the label.
+ * By default, this is DISABLED.
+ */
+EAPI Eina_Bool elm_frame_autocollapse_get(Evas_Object *obj);
+
+/**
+ * @brief Manually collapse a frame
+ * @param obj The frame
+ * @param enable true to collapse, false to expand
+ *
+ * Use this to toggle the collapsed state of a frame.
+ */
+EAPI void elm_frame_collapse_set(Evas_Object *obj, Eina_Bool enable);
+
+/**
+ * @brief Determine the collapse state of a frame
+ * @param obj The frame
+ * @return true if collapsed, false otherwise
+ *
+ * Use this to determine the collapse state of a frame.
+ */
+EAPI Eina_Bool elm_frame_collapse_get(Evas_Object *obj);
+/**
* @}
*/