const char *style;
unsigned int focus_order;
Eina_Bool focus_order_on_calc;
-
+
int child_drag_x_locked;
int child_drag_y_locked;
Eina_Bool drag_x_locked : 1;
Eina_Bool drag_y_locked : 1;
-
+
Eina_Bool can_focus : 1;
Eina_Bool child_can_focus : 1;
Eina_Bool focused : 1;
Eina_Bool highlight_in_theme : 1;
Eina_Bool disabled : 1;
Eina_Bool is_mirrored : 1;
+ Eina_Bool mirrored_auto_mode : 1; /* This is TRUE by default */
Eina_List *focus_chain;
Eina_List *event_cb;
_sub_obj_mouse_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
Evas_Object *o = obj;
- do
+ do
{
if (_elm_widget_is(o)) break;
o = evas_object_smart_parent_get(o);
_elm_widget_type_clear(void)
{
const char **ptr;
-
+
EINA_LIST_FREE(widtypes, ptr)
{
eina_stringshare_del(*ptr);
}
}
+/**
+ * @internal
+ * Resets the mirrored mode from the system mirror mode for widgets that are in
+ * automatic mirroring mode. This function does not call elm_widget_theme.
+ *
+ * @param obj The widget.
+ * @param mirrored EINA_TRUE to set mirrored mode. EINA_FALSE to unset.
+ */
+void
+_elm_widget_mirrored_reload(Evas_Object *obj)
+{
+ API_ENTRY return;
+ Eina_Bool mirrored = elm_mirrored_get();
+ if (elm_widget_mirrored_automatic_get(obj) && (sd->is_mirrored != mirrored))
+ {
+ sd->is_mirrored = mirrored;
+ }
+}
+
+/**
+ * Returns the widget's mirrored mode setting.
+ *
+ * @param obj The widget.
+ * @return mirrored mode setting of the object.
+ *
+ **/
+EAPI Eina_Bool
+elm_widget_mirrored_automatic_get(const Evas_Object *obj)
+{
+ API_ENTRY return EINA_FALSE;
+ return sd->mirrored_auto_mode;
+}
+
+/**
+ * Sets the widget's mirrored mode setting.
+ * When widget in automatic mode, it follows the system mirrored mode set by
+ * elm_mirrored_set().
+ * @param obj The widget.
+ * @param automatic EINA_TRUE for auto mirrored mode. EINA_FALSE for manual.
+ */
+EAPI void
+elm_widget_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic)
+{
+ API_ENTRY return;
+ if (sd->mirrored_auto_mode != automatic)
+ {
+ sd->mirrored_auto_mode = automatic;
+
+ if (automatic)
+ {
+ elm_widget_mirrored_set(obj, elm_mirrored_get());
+ }
+ }
+}
+
EAPI void
elm_widget_on_focus_hook_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj), void *data)
{
{
if (sd2->parent_obj == obj)
return;
- elm_widget_sub_object_del(sd2->parent_obj, sobj);
+ if (sd2->parent_obj)
+ elm_widget_sub_object_del(sd2->parent_obj, sobj);
sd2->parent_obj = obj;
if (!sd->child_can_focus && (_is_focusable(sobj)))
sd->child_can_focus = EINA_TRUE;
if (data)
{
if (data == obj) return;
- evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL,
+ evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL,
_sub_obj_del);
}
}
}
else
sd->subobjs = eina_list_remove(sd->subobjs, sobj);
- evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL,
+ evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL,
_sub_obj_del, sd);
evas_object_smart_callback_call(obj, "sub-object-del", sobj);
}
{
parent = elm_widget_parent_get(parent);
sd = evas_object_smart_data_get(parent);
- if (elm_widget_focus_get(sd->resize_obj))
- {
- elm_widget_focused_object_clear(sd->resize_obj);
- }
- else
+ if ((sd->resize_obj) && (elm_widget_focus_get(sd->resize_obj)))
+ elm_widget_focused_object_clear(sd->resize_obj);
+ else
{
const Eina_List *l;
Evas_Object *child;
do
{
- parent_obj = sd->parent_obj;
- child_obj = sd->obj;
+ parent_obj = sd->parent_obj;
+ if ((!parent_obj) || (!_elm_widget_is(parent_obj))) break;
sd = evas_object_smart_data_get(parent_obj);
-
- if ((!parent_obj) || (!sd) || (!_elm_widget_is(parent_obj))) break;
+ if (!sd) break;
+ child_obj = sd->obj;
evas_object_geometry_get(parent_obj, &px, &py, NULL, NULL);
evas_object_geometry_get(child_obj, &cx, &cy, NULL, NULL);
elm_widget_style_set(Evas_Object *obj, const char *style)
{
API_ENTRY return;
-
+
if (eina_stringshare_replace(&sd->style, style))
elm_widget_theme(obj);
}
sd->obj = obj;
sd->x = sd->y = sd->w = sd->h = 0;
sd->can_focus = 1;
+ sd->mirrored_auto_mode = EINA_TRUE; /* will follow system locale settings */
evas_object_smart_data_set(obj, sd);
}
{
const Eina_List *l;
Evas_Object *child, *ret, *best;
-
+
API_ENTRY return NULL;
if (!evas_object_visible_get(obj)) return NULL;
best = NULL;
if (!ret) continue;
best = ret;
}
- if ((can_focus_only) && (!elm_widget_can_focus_get(best))) return NULL;
+ if (can_focus_only)
+ {
+ if ((!best) || (!elm_widget_can_focus_get(best)))
+ return NULL;
+ }
return best;
}
Evas_Object *top;
Evas_Object *newest = NULL;
unsigned int newest_focus_order = 0;
-
+
INTERNAL_ENTRY;
if (!sd->focused) return;