EAPI Elm_Icon_Lookup_Order elm_toolbar_icon_order_lookup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
+ * Set whether the toolbar should always have an item selected.
+ *
+ * @param obj The toolbar object.
+ * @param wrap @c EINA_TRUE to enable always-select mode or @c EINA_FALSE to
+ * disable it.
+ *
+ * This will cause the toolbar to always have an item selected, and clicking
+ * the selected item will not cause a selected event to be emitted. Enabling this mode
+ * will immediately select the first toolbar item.
+ *
+ * Always-selected is disabled by default.
+ *
+ * @see elm_toolbar_always_select_mode_get().
+ *
+ * @ingroup Toolbar
+ */
+ EAPI void elm_toolbar_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select) EINA_ARG_NONNULL(1);
+
+ /**
+ * Get whether the toolbar should always have an item selected.
+ *
+ * @param obj The toolbar object.
+ * @return @c EINA_TRUE means an item will always be selected, @c EINA_FALSE indicates
+ * that it is possible to have no items selected. If @p obj is @c NULL, @c EINA_FALSE is returned.
+ *
+ * @see elm_toolbar_always_select_mode_set() for details.
+ *
+ * @ingroup Toolbar
+ */
+ EAPI Eina_Bool elm_toolbar_always_select_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+
+ /**
* Set whether the toolbar items' should be selected by the user or not.
*
* @param obj The toolbar object.
double align;
Eina_Bool homogeneous : 1;
Eina_Bool no_select : 1;
+ Eina_Bool always_select : 1;
Eina_Bool vertical : 1;
Ecore_Job *resize_job;
};
if (!wd->no_select)
{
- if (sel) _item_unselect(it);
+ if (sel)
+ {
+ if (wd->always_select) return;
+ _item_unselect(it);
+ }
else
{
it2 = elm_toolbar_selected_item_get(it->base.widget);
evas_object_size_hint_min_set(it->base.view, mw, mh);
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_RESIZE,
_resize_item, obj);
+ if ((!wd->items) && wd->always_select) _item_select(it);
return it;
}
{
Widget_Data *wd;
Evas_Object *obj2;
+ Elm_Toolbar_Item *next;
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
wd = elm_widget_data_get(item->base.widget);
if (!wd) return;
obj2 = item->base.widget;
+ next = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(item)->next);
wd->items = eina_inlist_remove(wd->items, EINA_INLIST_GET(item));
+ if (!next) next = ELM_TOOLBAR_ITEM_FROM_INLIST(wd->items);
+ if (wd->always_select && item->selected && next) _item_select(next);
_item_del(item);
_theme_hook(obj2);
}
}
EAPI void
+elm_toolbar_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ if (always_select && (!wd->always_select) && wd->items)
+ _item_select(ELM_TOOLBAR_ITEM_FROM_INLIST(wd->items));
+ wd->always_select = always_select;
+}
+
+EAPI Eina_Bool
+elm_toolbar_always_select_mode_get(const Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return EINA_FALSE;
+ return wd->always_select;
+}
+
+EAPI void
elm_toolbar_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select)
{
ELM_CHECK_WIDTYPE(obj, widtype);