elm toolbar - fix toolbar item separators and refactor aling/fill of item
only set this is one place and thus get it consistent/right for separators vs other items. @fix
This commit is contained in:
parent
efd45df1c4
commit
db18d67af9
|
@ -1255,6 +1255,41 @@ _item_shrink_signal_emit(Evas_Object *view, Elm_Toolbar_Shrink_Mode shrink_mode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_item_fill_align_set(Elm_Toolbar_Data *sd, Elm_Toolbar_Item_Data *it)
|
||||||
|
{
|
||||||
|
if (sd->shrink_mode != ELM_TOOLBAR_SHRINK_EXPAND)
|
||||||
|
{
|
||||||
|
if (it->separator)
|
||||||
|
{
|
||||||
|
if (!efl_ui_layout_orientation_is_horizontal(sd->dir, EINA_TRUE))
|
||||||
|
evas_object_size_hint_weight_set(VIEW(it), -1.0, 0.0);
|
||||||
|
else
|
||||||
|
evas_object_size_hint_weight_set(VIEW(it), 0.0, -1.0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!efl_ui_layout_orientation_is_horizontal(sd->dir, EINA_TRUE))
|
||||||
|
evas_object_size_hint_weight_set(VIEW(it), EVAS_HINT_EXPAND, 0.0);
|
||||||
|
else
|
||||||
|
evas_object_size_hint_weight_set(VIEW(it), 0.0, EVAS_HINT_EXPAND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (it->separator)
|
||||||
|
{
|
||||||
|
if (!efl_ui_layout_orientation_is_horizontal(sd->dir, EINA_TRUE))
|
||||||
|
evas_object_size_hint_weight_set(VIEW(it), -1.0, 0.0);
|
||||||
|
else
|
||||||
|
evas_object_size_hint_weight_set(VIEW(it), 0.0, -1.0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
evas_object_size_hint_weight_set(VIEW(it), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
}
|
||||||
|
evas_object_size_hint_align_set(VIEW(it), EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_item_theme_hook(Evas_Object *obj,
|
_item_theme_hook(Evas_Object *obj,
|
||||||
Elm_Toolbar_Item_Data *it,
|
Elm_Toolbar_Item_Data *it,
|
||||||
|
@ -1327,28 +1362,7 @@ _item_theme_hook(Evas_Object *obj,
|
||||||
edje_object_message_signal_process(elm_layout_edje_get(view));
|
edje_object_message_signal_process(elm_layout_edje_get(view));
|
||||||
if (!it->separator && !it->object)
|
if (!it->separator && !it->object)
|
||||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||||
if (sd->shrink_mode != ELM_TOOLBAR_SHRINK_EXPAND)
|
_item_fill_align_set(sd, it);
|
||||||
{
|
|
||||||
if (!efl_ui_layout_orientation_is_horizontal(sd->dir, EINA_TRUE))
|
|
||||||
{
|
|
||||||
evas_object_size_hint_weight_set(view, EVAS_HINT_EXPAND, -1.0);
|
|
||||||
evas_object_size_hint_align_set
|
|
||||||
(view, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
evas_object_size_hint_weight_set(VIEW(it), -1.0, EVAS_HINT_EXPAND);
|
|
||||||
evas_object_size_hint_align_set
|
|
||||||
(view, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
evas_object_size_hint_weight_set
|
|
||||||
(VIEW(it), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
||||||
evas_object_size_hint_align_set
|
|
||||||
(VIEW(it), EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
||||||
}
|
|
||||||
_resizing_eval_item(it);
|
_resizing_eval_item(it);
|
||||||
evas_object_smart_need_recalculate_set(obj, EINA_TRUE);
|
evas_object_smart_need_recalculate_set(obj, EINA_TRUE);
|
||||||
}
|
}
|
||||||
|
@ -2485,28 +2499,8 @@ _item_new(Evas_Object *obj,
|
||||||
|
|
||||||
edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
|
edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
|
||||||
|
|
||||||
if (sd->shrink_mode != ELM_TOOLBAR_SHRINK_EXPAND)
|
_item_fill_align_set(sd, it);
|
||||||
{
|
|
||||||
if (!efl_ui_layout_orientation_is_horizontal(sd->dir, EINA_TRUE))
|
|
||||||
{
|
|
||||||
evas_object_size_hint_weight_set(VIEW(it), EVAS_HINT_EXPAND, -1.0);
|
|
||||||
evas_object_size_hint_align_set
|
|
||||||
(VIEW(it), EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
evas_object_size_hint_weight_set(VIEW(it), -1.0, EVAS_HINT_EXPAND);
|
|
||||||
evas_object_size_hint_align_set
|
|
||||||
(VIEW(it), EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
evas_object_size_hint_weight_set
|
|
||||||
(VIEW(it), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
||||||
evas_object_size_hint_align_set
|
|
||||||
(VIEW(it), EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
||||||
}
|
|
||||||
efl_ui_focus_composition_dirty(obj);
|
efl_ui_focus_composition_dirty(obj);
|
||||||
|
|
||||||
evas_object_event_callback_add
|
evas_object_event_callback_add
|
||||||
|
@ -3373,7 +3367,7 @@ _elm_toolbar_item_separator_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *
|
||||||
item->separator = separator;
|
item->separator = separator;
|
||||||
scale = (efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
|
scale = (efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
|
||||||
_item_theme_hook(obj, item, scale, sd->icon_size);
|
_item_theme_hook(obj, item, scale, sd->icon_size);
|
||||||
evas_object_size_hint_min_set(VIEW(item), -1, -1);
|
_item_fill_align_set(sd, item);
|
||||||
if (separator) sd->separator_count++;
|
if (separator) sd->separator_count++;
|
||||||
else sd->separator_count--;
|
else sd->separator_count--;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue