{
ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item);
elm_object_style_set(VIEW(item), buf);
- elm_object_text_set(VIEW(item), item->label);
+ // TIZEN_ONLY(20150828): shrink item width expanding over hover parent
+ // elm_object_text_set(VIEW(item), item->label);
+ eo_do(eo_item, elm_wdg_item_part_text_set(NULL, item->label));
+ //
elm_widget_disabled_set
(VIEW(item), eo_do_ret(eo_item, int_ret, elm_wdg_item_disabled_get()));
}
if ((!sd->expanded) || (!bx)) return;
+ // TIZEN_ONLY(20150828): shrink item width expanding over hover parent
+ Eina_List *l;
+ Elm_Object_Item *eo_it;
+ Evas_Coord it_h;
+
+ if (!sd->horizontal)
+ {
+ EINA_LIST_FOREACH(sd->items, l, eo_it)
+ {
+ ELM_HOVERSEL_ITEM_DATA_GET(eo_it, it);
+
+ evas_object_size_hint_min_get(VIEW(it), NULL, &it_h);
+ evas_object_size_hint_min_set(VIEW(it), it->minw, it_h);
+ }
+ }
+ //
+
+ elm_layout_signal_emit(sd->hover, "elm,state,align,default", "elm");
+ edje_object_message_signal_process(elm_layout_edje_get(sd->hover));
+
elm_box_recalculate(bx);
evas_object_size_hint_min_get(bx, &box_w, &box_h);
}
}
}
- if (ww < obj_w) ww = obj_w;
evas_object_size_hint_min_set(sd->spacer, ww, hh);
// TIZEN_ONLY(20150828): shrink item width expanding over hover parent
if (!sd->horizontal)
{
- Eina_List *l;
- Evas_Object *it;
- Evas_Coord it_w, it_h;
-
- l = elm_box_children_get(bx);
- EINA_LIST_FREE(l, it)
+ EINA_LIST_FOREACH(sd->items, l, eo_it)
{
- evas_object_size_hint_min_get(it, &it_w, &it_h);
- if (it_w > ww)
- evas_object_size_hint_min_set(it, ww, it_h);
+ ELM_HOVERSEL_ITEM_DATA_GET(eo_it, it);
+
+ evas_object_size_hint_min_get(VIEW(it), NULL, &it_h);
+ evas_object_size_hint_min_set(VIEW(it), (it->minw > ww) ? ww : it->minw, it_h);
}
}
//
eina_stringshare_replace(&it->label, label);
if (VIEW(it))
- elm_object_text_set(VIEW(it), label);
+ // TIZEN_ONLY(20150828): shrink item width expanding over hover parent
+ //elm_object_text_set(VIEW(it), label);
+ {
+ elm_object_text_set(VIEW(it), label);
+ evas_object_size_hint_min_get(VIEW(it), &it->minw, NULL);
+ }
}
static const char *
VIEW(item) = bt = elm_button_add(obj);
elm_widget_mirrored_set(bt, elm_widget_mirrored_get(obj));
elm_object_style_set(bt, buf);
- elm_object_text_set(bt, item->label);
+ // TIZEN_ONLY(20150828): shrink item width expanding over hover parent
+ // elm_object_text_set(bt, item->label);
+ //
if (item->icon_file)
{
elm_object_part_content_set(bt, "icon", ic);
}
- evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
- evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
- eo_do(bt,
- eo_event_callback_add(EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_item_clicked, item),
- eo_event_callback_add(ELM_WIDGET_EVENT_FOCUSED, _item_focused_cb, item),
- eo_event_callback_add(ELM_WIDGET_EVENT_UNFOCUSED, _item_unfocused_cb, item));
+ // TIZEN_ONLY(20150828): shrink item width expanding over hover parent
+ // To get proper size hint min width, set text after setting icon
+ eo_do(eo_item, elm_wdg_item_part_text_set(NULL, item->label));
+ //
+ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ eo_do(bt,
+ eo_event_callback_add(EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_item_clicked, item),
+ eo_event_callback_add(ELM_WIDGET_EVENT_FOCUSED, _item_focused_cb, item),
+ eo_event_callback_add(ELM_WIDGET_EVENT_UNFOCUSED, _item_unfocused_cb, item));
sd->items = eina_list_append(sd->items, eo_item);
(sd->target, EVAS_CALLBACK_DEL, _target_del_cb, obj);
evas_object_event_callback_del_full
(sd->target, EVAS_CALLBACK_MOVE, _target_move_cb, obj);
+ evas_object_event_callback_del_full
+ (sd->target, EVAS_CALLBACK_RESIZE, _target_move_cb, obj);
elm_widget_hover_object_set(sd->target, NULL);
}
(sd->target, EVAS_CALLBACK_DEL, _target_del_cb, obj);
evas_object_event_callback_add
(sd->target, EVAS_CALLBACK_MOVE, _target_move_cb, obj);
+ evas_object_event_callback_add
+ (sd->target, EVAS_CALLBACK_RESIZE, _target_move_cb, obj);
elm_widget_hover_object_set(target, obj);
elm_layout_sizing_eval(obj);
}