static void
fill(Evas_Object *win, Eina_Bool do_bg)
{
- Evas_Object *bg, *sc, *bx, *ic, *bb, *av;
+ Evas_Object *bg, *sc, *bx, *ic, *bb, *av, *en;
char buf[PATH_MAX];
if (do_bg)
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ en = elm_scrolled_entry_add(win);
+ evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
+ elm_scrolled_entry_entry_set(en, "This is a single line");
+ elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
+ elm_scrolled_entry_single_line_set(en, 1);
+ evas_object_show(en);
+ elm_box_pack_end(bx, en);
+
+ en = elm_scrolled_entry_add(win);
+ evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
+ elm_scrolled_entry_entry_set(en, "Entry 2");
+ elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
+ elm_scrolled_entry_single_line_set(en, 1);
+ evas_object_show(en);
+ elm_box_pack_end(bx, en);
+
ic = elm_icon_add(win);
snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
elm_icon_file_set(ic, buf, NULL);
Evas_Object *obj,
void *event_info __UNUSED__)
{
- _if_focused_revert(obj, EINA_TRUE);
+ elm_widget_focus_hide_handle(obj);
}
static void
Evas_Object *obj,
void *event_info __UNUSED__)
{
- Evas_Object *o = obj;
- do
- {
- if (_elm_widget_is(o)) break;
- o = evas_object_smart_parent_get(o);
- }
- while (o);
- if (!o) return;
- if (!_is_focusable(o)) return;
- elm_widget_focus_steal(o);
+ elm_widget_focus_mouse_down_handle(obj);
}
static void
EINA_LIST_FREE(list, s) eina_stringshare_del(s);
}
+EAPI void
+elm_widget_focus_hide_handle(Evas_Object *obj)
+{
+ _if_focused_revert(obj, EINA_TRUE);
+}
+
+EAPI void
+elm_widget_focus_mouse_down_handle(Evas_Object *obj)
+{
+ Evas_Object *o = obj;
+ do
+ {
+ if (_elm_widget_is(o)) break;
+ o = evas_object_smart_parent_get(o);
+ }
+ while (o);
+ if (!o) return;
+ if (!_is_focusable(o)) return;
+ elm_widget_focus_steal(o);
+}
+
/**
* @internal
*
(void)top;
(void)output;
#endif
-}
\ No newline at end of file
+}
EAPI Eina_Bool elm_widget_type_check(const Evas_Object *obj, const char *type);
EAPI Eina_List *elm_widget_stringlist_get(const char *str);
EAPI void elm_widget_stringlist_free(Eina_List *list);
+EAPI void elm_widget_focus_hide_handle(Evas_Object *obj);
+EAPI void elm_widget_focus_mouse_down_handle(Evas_Object *obj);
EAPI Elm_Widget_Item *_elm_widget_item_new(Evas_Object *parent, size_t alloc_size);
EAPI void _elm_widget_item_del(Elm_Widget_Item *item);
Eina_Bool elm_drop_target_del(Evas_Object *widget);
Eina_Bool elm_drag_start(Evas_Object *, Elm_Sel_Format, const char *, void (*)(void *,Evas_Object*),void*);
-
#endif
static void
_elm_win_on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
{
- if (elm_widget_focus_get(obj))
- evas_object_focus_set(obj, EINA_TRUE);
+ Elm_Win *win = elm_widget_data_get(obj);
+ if (!win) return;
+
+ if (win->img_obj)
+ evas_object_focus_set(win->img_obj, elm_widget_focus_get(obj));
else
- evas_object_focus_set(obj, EINA_FALSE);
+ evas_object_focus_set(obj, elm_widget_focus_get(obj));
}
static Eina_Bool
Evas_Event_Key_Down *ev = event_info;
if (!strcmp(ev->keyname, "Tab"))
{
- if(evas_key_modifier_is_set(ev->modifiers, "Shift"))
+ if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
else
elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
}
#endif
+static void
+_win_img_hide(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ Elm_Win *win = data;
+
+ elm_widget_focus_hide_handle(win->win_obj);
+}
+
+static void
+_win_img_mouse_down(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ Elm_Win *win = data;
+ elm_widget_focus_mouse_down_handle(win->win_obj);
+}
+
+static void
+_win_img_focus_in(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ Elm_Win *win = data;
+ elm_widget_focus_steal(win->win_obj);
+}
+
+static void
+_win_img_focus_out(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ Elm_Win *win = data;
+ elm_widget_focused_object_clear(win->win_obj);
+}
+
+static void
+_win_inlined_image_set(Elm_Win *win)
+{
+ evas_object_image_alpha_set(win->img_obj, EINA_FALSE);
+ evas_object_image_filled_set(win->img_obj, EINA_TRUE);
+ evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_DEL,
+ _elm_win_obj_callback_img_obj_del, win);
+
+ evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_HIDE,
+ _win_img_hide, win);
+ evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_MOUSE_DOWN,
+ _win_img_mouse_down, win);
+ evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_FOCUS_IN,
+ _win_img_focus_in, win);
+ evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_FOCUS_OUT,
+ _win_img_focus_out, win);
+}
+
/**
* Adds a window object. If this is the first window created, pass NULL as
* @p parent.
win->ee = ecore_evas_object_ecore_evas_get(win->img_obj);
if (win->ee)
{
- evas_object_image_alpha_set
- (win->img_obj, EINA_FALSE);
- evas_object_image_filled_set
- (win->img_obj, EINA_TRUE);
- evas_object_event_callback_add
- (win->img_obj, EVAS_CALLBACK_DEL,
- _elm_win_obj_callback_img_obj_del,
- win);
+ _win_inlined_image_set(win);
}
else
{