forked from enlightenment/efl
parent
5dd010bb26
commit
5884ebfb18
|
@ -19,7 +19,8 @@ ico_notepad.png \
|
|||
ico_radio.png \
|
||||
ico_scrolled_entry.png \
|
||||
ico_slider.png \
|
||||
ico_toggle.png
|
||||
ico_toggle.png \
|
||||
ico_toolbar.png
|
||||
|
||||
icons.edj: Makefile $(EXTRA_DIST)
|
||||
$(EDJE_CC) $(EDJE_FLAGS) \
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 5.9 KiB |
|
@ -21,3 +21,4 @@ ICON("radio")
|
|||
ICON("scrolled_entry")
|
||||
ICON("slider")
|
||||
ICON("toggle")
|
||||
ICON("toolbar")
|
||||
|
|
|
@ -36,7 +36,8 @@ elm_notepad.c \
|
|||
elm_radio.c \
|
||||
elm_scrolled_entry.c \
|
||||
elm_slider.c \
|
||||
elm_toggle.c
|
||||
elm_toggle.c \
|
||||
elm_toolbar.c
|
||||
|
||||
elm_la_LIBADD = $(top_builddir)/src/lib/libelementary.la
|
||||
elm_la_LDFLAGS = $(all_libraries) -no-undefined @lt_enable_auto_import@ -module -avoid-version -shared -fPIC
|
||||
|
|
|
@ -0,0 +1,120 @@
|
|||
#include "private.h"
|
||||
|
||||
typedef struct _Elm_Params_Toolbar
|
||||
{
|
||||
Evas_Object *icon;
|
||||
int icon_size;
|
||||
Eina_Bool icon_size_exists:1;
|
||||
double align;
|
||||
Eina_Bool align_exists:1;
|
||||
} Elm_Params_Toolbar;
|
||||
|
||||
static void
|
||||
external_toolbar_state_set(void *data __UNUSED__, Evas_Object *obj, const void *from_params, const void *to_params, float pos __UNUSED__)
|
||||
{
|
||||
const Elm_Params_Toolbar *p;
|
||||
|
||||
if (to_params) p = to_params;
|
||||
else if (from_params) p = from_params;
|
||||
else return;
|
||||
|
||||
if (p->icon_size_exists)
|
||||
elm_toolbar_icon_size_set(obj, p->icon_size);
|
||||
if (p->align_exists)
|
||||
elm_toolbar_align_set(obj, p->align);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
external_toolbar_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param)
|
||||
{
|
||||
if (!strcmp(param->name, "icon_size"))
|
||||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
|
||||
{
|
||||
elm_toolbar_icon_size_set(obj, param->i);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
else if (!strcmp(param->name, "align"))
|
||||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
|
||||
{
|
||||
elm_toolbar_align_set(obj, param->d);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
ERR("unknown parameter '%s' of type '%s'",
|
||||
param->name, edje_external_param_type_str(param->type));
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
external_toolbar_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_External_Param *param)
|
||||
{
|
||||
if (!strcmp(param->name, "icon_size"))
|
||||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
|
||||
{
|
||||
param->i = elm_toolbar_icon_size_get(obj);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
else if (!strcmp(param->name, "align"))
|
||||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
|
||||
{
|
||||
param->d = elm_toolbar_align_get(obj);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
ERR("unknown parameter '%s' of type '%s'",
|
||||
param->name, edje_external_param_type_str(param->type));
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static void *
|
||||
external_toolbar_params_parse(void *data, Evas_Object *obj, const Eina_List *params)
|
||||
{
|
||||
Elm_Params_Toolbar *mem;
|
||||
Edje_External_Param *param;
|
||||
const Eina_List *l;
|
||||
|
||||
mem = calloc(1, sizeof(Elm_Params_Toolbar));
|
||||
if (!mem)
|
||||
return NULL;
|
||||
|
||||
EINA_LIST_FOREACH(params, l, param)
|
||||
{
|
||||
if (!strcmp(param->name, "icon_size"))
|
||||
{
|
||||
mem->icon_size = param->i;
|
||||
mem->icon_size_exists = EINA_TRUE;
|
||||
}
|
||||
else if (!strcmp(param->name, "align"))
|
||||
{
|
||||
mem->align = param->d;
|
||||
mem->align_exists = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return mem;
|
||||
}
|
||||
|
||||
static void
|
||||
external_toolbar_params_free(void *params)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static Edje_External_Param_Info external_toolbar_params[] = {
|
||||
EDJE_EXTERNAL_PARAM_INFO_INT("icon_size"),
|
||||
EDJE_EXTERNAL_PARAM_INFO_DOUBLE("align"),
|
||||
EDJE_EXTERNAL_PARAM_INFO_SENTINEL
|
||||
};
|
||||
|
||||
DEFINE_EXTERNAL_ICON_ADD(toolbar, "toolbar");
|
||||
DEFINE_EXTERNAL_TYPE_SIMPLE(toolbar, "Toolbar");
|
|
@ -9,3 +9,4 @@ DEFINE_TYPE(radio)
|
|||
DEFINE_TYPE(scrolled_entry)
|
||||
DEFINE_TYPE(slider)
|
||||
DEFINE_TYPE(toggle)
|
||||
DEFINE_TYPE(toolbar)
|
||||
|
|
|
@ -781,6 +781,7 @@ extern "C" {
|
|||
EAPI void elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent);
|
||||
EAPI void elm_toolbar_item_unselect_all(Evas_Object *obj);
|
||||
EAPI void elm_toolbar_align_set(Evas_Object *obj, double align);
|
||||
EAPI double elm_toolbar_align_get(const Evas_Object *obj);
|
||||
EAPI void elm_toolbar_item_menu_set(Elm_Toolbar_Item *item, Eina_Bool menu);
|
||||
EAPI Evas_Object *elm_toolbar_item_menu_get(Elm_Toolbar_Item *item);
|
||||
/* smart callbacks called:
|
||||
|
|
|
@ -573,6 +573,16 @@ elm_toolbar_align_set(Evas_Object *obj, double align)
|
|||
wd->align = align;
|
||||
}
|
||||
|
||||
EAPI double
|
||||
elm_toolbar_align_get(const Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) 0.0;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
if (!wd) return 0.0;
|
||||
return wd->align;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_toolbar_item_menu_set(Elm_Toolbar_Item *item, Eina_Bool menu)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue