Elm_Dialoguegroup_Item_Style style;
const char *location;
Eina_Bool press;
- Eina_Bool line_show;
+// Eina_Bool line_show;
};
if (!wd) return;
if (wd->title) {
- elm_layout_theme_set(wd->title_layout, "dialoguegroup", "base", "title");
+ elm_layout_theme_set(wd->title_layout, "dialoguegroup", "title", elm_widget_style_get(obj));
edje_object_part_text_set(elm_layout_edje_get(wd->title_layout), "text", wd->title);
}
EINA_LIST_FOREACH(wd->items, l, item)
static void _set_item_theme(Dialogue_Item *item, const char *location)
{
if (!item) return;
+ char buf[30];
- if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_DEFAULT)
- elm_layout_theme_set(item->bg_layout, "dialoguegroup", "bg", location);
- else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD)
- elm_layout_theme_set(item->bg_layout, "dialoguegroup", "editfield", location);
+ if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_DEFAULT)
+ snprintf(buf, sizeof(buf), "bg_%s", location);
+ else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD)
+ snprintf(buf, sizeof(buf), "editfield_%s", location);
+ else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD_WITH_TITLE)
+ snprintf(buf, sizeof(buf), "editfield_with_title_%s", location);
+ else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDIT_TITLE)
+ snprintf(buf, sizeof(buf), "edit_title_%s", location);
+ else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_HIDDEN)
+ snprintf(buf, sizeof(buf), "hidden_%s", location);
+ elm_layout_theme_set(item->bg_layout, "dialoguegroup", buf, elm_widget_style_get(item->parent));
}
+/*
static void _set_line_show(Dialogue_Item *item, Dialogue_Item *after)
{
if(!item || !after) return;
else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD)
item->line_show = EINA_TRUE;
}
+*/
static void _change_item_bg(Dialogue_Item *item, const char *location)
{
if(item->press == EINA_TRUE)
edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,on", "elm");
else
- edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,off", "elm");
+ edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,off", "elm");
- if(item->line_show == EINA_FALSE)
- edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,line,hide", "elm");
+/* if(item->line_show == EINA_FALSE)
+ edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,line,hide", "elm");*/
}
item->content = subobj;
item->press = EINA_TRUE;
item->style = style;
- item->line_show = EINA_TRUE;
+// item->line_show = EINA_TRUE;
eina_stringshare_replace(&item->location, location);
- item->bg_layout = elm_layout_add(wd->parent);
+ item->bg_layout = elm_layout_add(wd->box);
_set_item_theme(item, location);
evas_object_size_hint_weight_set(item->bg_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(item->bg_layout, EVAS_HINT_FILL, 0.0);
wd->parent = parent;
wd->num = 0;
- wd->box = elm_box_add(parent);
+ wd->box = elm_box_add(obj);
evas_object_event_callback_add(wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
evas_object_show(wd->box);
elm_widget_resize_object_set(obj, wd->box);
_change_item_bg(item, "middle");
}
new_item = _create_item(obj, subobj, style, "bottom");
- _set_line_show(item, new_item);
+// _set_line_show(item, new_item);
}
elm_box_pack_end(wd->box, new_item->bg_layout);
wd->items = eina_list_append(wd->items, new_item);
_change_item_bg(item, "middle");
}
new_item = _create_item(obj, subobj, style, "top");
- _set_line_show(new_item, item);
+// _set_line_show(new_item, item);
}
if(wd->title_layout)
elm_box_pack_after(wd->box, new_item->bg_layout, wd->title_layout);
elm_box_pack_after(wd->box, item->bg_layout, after_item->bg_layout);
wd->items = eina_list_append_relative(wd->items, item, after_item);
- _set_line_show(after, item);
+ // _set_line_show(after, item);
}
}
else if( !strcmp(before_item->location, "middle") || !strcmp(before_item->location, "bottom") ) {
item = _create_item(obj, subobj, style, "middle");
prev = eina_list_prev(l);
- _set_line_show(prev->data, item);
+ // _set_line_show(prev->data, item);
}
elm_box_pack_before(wd->box, item->bg_layout, before_item->bg_layout);
wd->items = eina_list_prepend_relative(wd->items, item, before_item);
elm_box_unpack(wd->box, wd->title_layout);
}
if (!wd->title_layout) {
- wd->title_layout = elm_layout_add(wd->parent);
- elm_widget_sub_object_add(obj, wd->title_layout);
- elm_layout_theme_set(wd->title_layout, "dialoguegroup", "base", "title");
+ wd->title_layout = elm_layout_add(wd->box);
+ elm_layout_theme_set(wd->title_layout, "dialoguegroup", "title", elm_widget_style_get(obj));
evas_object_size_hint_weight_set(wd->title_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(wd->title_layout, EVAS_HINT_FILL, 0.0);
evas_object_show(wd->title_layout);