forked from enlightenment/efl
password mode - really dont allow selecting of passwords form password fields.
SVN revision: 47467
This commit is contained in:
parent
b01e9fc400
commit
d8f22e5020
|
@ -8,6 +8,7 @@ struct _Widget_Data
|
|||
Evas_Object *scroller;
|
||||
Evas_Object *entry;
|
||||
Elm_Scroller_Policy policy_h, policy_v;
|
||||
Eina_Bool single_line : 1;
|
||||
};
|
||||
|
||||
static const char *widtype = NULL;
|
||||
|
@ -36,6 +37,9 @@ _sizing_eval(Evas_Object *obj)
|
|||
if (!wd) return;
|
||||
evas_object_size_hint_min_get(wd->scroller, &minw, &minh);
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
if (wd->single_line)
|
||||
evas_object_size_hint_max_set(obj, -1, minh);
|
||||
else
|
||||
evas_object_size_hint_max_set(obj, -1, -1);
|
||||
}
|
||||
|
||||
|
@ -164,6 +168,7 @@ elm_scrolled_entry_add(Evas_Object *parent)
|
|||
wd->scroller = elm_scroller_add(parent);
|
||||
elm_widget_resize_object_set(obj, wd->scroller);
|
||||
elm_scroller_bounce_set(wd->scroller, 0, 0);
|
||||
|
||||
wd->entry = elm_entry_add(parent);
|
||||
evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
@ -196,7 +201,9 @@ elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->single_line == single_line) return;
|
||||
elm_entry_single_line_set(wd->entry, single_line);
|
||||
wd->single_line = single_line;
|
||||
if (single_line)
|
||||
{
|
||||
elm_scroller_policy_set(wd->scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
|
||||
|
@ -207,6 +214,7 @@ elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
|
|||
elm_scroller_policy_set(wd->scroller, wd->policy_h, wd->policy_v);
|
||||
elm_scroller_content_min_limit(wd->scroller, 0, 0);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
|
|
|
@ -273,7 +273,10 @@ _dismissed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
|||
if (!wd) return;
|
||||
if (wd->hoversel) evas_object_hide(wd->hoversel);
|
||||
if (wd->selmode)
|
||||
{
|
||||
if (!wd->password)
|
||||
edje_object_part_text_select_allow_set(wd->ent, "elm.text", 1);
|
||||
}
|
||||
elm_widget_scroll_freeze_pop(data);
|
||||
}
|
||||
|
||||
|
@ -284,6 +287,7 @@ _select(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
|||
if (!wd) return;
|
||||
wd->selmode = EINA_TRUE;
|
||||
edje_object_part_text_select_none(wd->ent, "elm.text");
|
||||
if (!wd->password)
|
||||
edje_object_part_text_select_allow_set(wd->ent, "elm.text", 1);
|
||||
edje_object_signal_emit(wd->ent, "elm,state,select,on", "elm");
|
||||
elm_widget_scroll_hold_push(data);
|
||||
|
@ -400,6 +404,7 @@ _long_press(void *data)
|
|||
evas_object_smart_callback_add(wd->hoversel, "dismissed", _dismissed, data);
|
||||
if (!wd->selmode)
|
||||
{
|
||||
if (!wd->password)
|
||||
elm_hoversel_item_add(wd->hoversel, "Select", NULL, ELM_ICON_NONE,
|
||||
_select, data);
|
||||
if (1) // need way to detect if someone has a selection
|
||||
|
@ -410,6 +415,8 @@ _long_press(void *data)
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!wd->password)
|
||||
{
|
||||
if (wd->have_selection)
|
||||
{
|
||||
|
@ -422,6 +429,7 @@ _long_press(void *data)
|
|||
elm_hoversel_item_add(wd->hoversel, "Cancel", NULL, ELM_ICON_NONE,
|
||||
_cancel, data);
|
||||
}
|
||||
}
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
{
|
||||
elm_hoversel_item_add(wd->hoversel, it->label, it->icon_file,
|
||||
|
|
|
@ -94,12 +94,12 @@ _sizing_eval(Evas_Object *obj)
|
|||
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord vw, vh, minw, minh, maxw, maxh, w, h, vmw, vmh;
|
||||
double xw, xy;
|
||||
double xw, yw;
|
||||
|
||||
if (!wd) return;
|
||||
evas_object_size_hint_min_get(wd->content, &minw, &minh);
|
||||
evas_object_size_hint_max_get(wd->content, &maxw, &maxh);
|
||||
evas_object_size_hint_weight_get(wd->content, &xw, &xy);
|
||||
evas_object_size_hint_weight_get(wd->content, &xw, &yw);
|
||||
if (wd->scr)
|
||||
{
|
||||
elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
|
||||
|
@ -109,7 +109,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
else if ((maxw > 0) && (vw > maxw)) vw = maxw;
|
||||
}
|
||||
else if (minw > 0) vw = minw;
|
||||
if (xy > 0.0)
|
||||
if (yw > 0.0)
|
||||
{
|
||||
if ((minh > 0) && (vh < minh)) vh = minh;
|
||||
else if ((maxh > 0) && (vh > maxh)) vh = maxh;
|
||||
|
|
Loading…
Reference in New Issue