*/
EAPI Eina_Bool elm_entry_context_menu_disabled_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
+ * This disables the entry's magnifer feature.
+ *
+ * @param obj The entry object
+ * @param disabled If true, the magnifier is not displayed
+ */
+ EAPI void elm_entry_magnifier_disabled_set(Evas_Object *obj, Eina_Bool disabled) EINA_ARG_NONNULL(1);
+ /**
+ * This returns whether the entry's magnifier feature is disabled.
+ *
+ * @param obj The entry object
+ * @return If true, the feature is disabled
+ */
+ EAPI Eina_Bool elm_entry_magnifier_disabled_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ /**
* This appends a custom item provider to the list for that entry
*
* This appends the given callback. The list is walked from beginning to end
eina_strbuf_append(html, trail->str);
}
+ eina_strbuf_replace_all(html, " ", " ");
char *ret = eina_strbuf_string_steal(html);
eina_strbuf_free(html);
return ret;
eina_strbuf_append(html, trail->str);
}
+ eina_strbuf_replace_all(html, " ", " ");
char *ret = eina_strbuf_string_steal(html);
eina_strbuf_free(html);
return ret;
sel = selections + *((int *)data);
if (!sel->active) return EINA_TRUE;
- if ((sel->format & ELM_SEL_FORMAT_MARKUP) ||
- (sel->format & ELM_SEL_FORMAT_HTML))
+ if (sel->format & ELM_SEL_FORMAT_MARKUP)
+ *data_ret = remove_tags(sel->selbuf, size_ret);
+ else if (sel->format & ELM_SEL_FORMAT_HTML)
{
- *data_ret = remove_tags(sel->selbuf, size_ret);
+ char *text = NULL;
+ Eina_Strbuf *buf = eina_strbuf_new();
+ if (buf)
+ {
+ eina_strbuf_append(buf, sel->selbuf);
+ eina_strbuf_replace_all(buf, " ", " ");
+ text = eina_strbuf_string_steal(buf);
+ eina_strbuf_free(buf);
+ *data_ret = remove_tags(text, size_ret);
+ free(text);
+ }
+ else
+ *data_ret = remove_tags(sel->selbuf, size_ret);
}
else if (sel->format & ELM_SEL_FORMAT_TEXT)
{
Eina_Bool double_clicked : 1;
Eina_Bool long_pressed : 1;
Eina_Bool context_menu : 1;
+ Eina_Bool magnifier_enabled : 1;
Eina_Bool drag_selection_asked : 1;
Eina_Bool bgcolor : 1;
Eina_Bool can_write : 1;
_cancel(data, NULL, NULL);
- _magnifier_create(data);
- _magnifier_move(data);
- _magnifier_show(data);
- elm_object_scroll_freeze_push(data);
+ if (wd->magnifier_enabled)
+ {
+ _magnifier_create(data);
+ _magnifier_move(data);
+ _magnifier_show(data);
+ elm_object_scroll_freeze_push(data);
+ }
evas_object_smart_callback_call(data, SIG_LONGPRESSED, NULL);
return ECORE_CALLBACK_CANCEL;
if ((wd->api) && (wd->api->obj_mouseup))
wd->api->obj_mouseup(data);
}
- _magnifier_hide(data);
- elm_object_scroll_freeze_pop(data);
+ if (wd->magnifier_enabled)
+ {
+ _magnifier_hide(data);
+ elm_object_scroll_freeze_pop(data);
+ }
if (wd->long_pressed)
_menu_press(data);
if (ev->buttons == 1)
{
- if (wd->long_pressed)
+ if ((wd->long_pressed) && (wd->magnifier_enabled))
{
_magnifier_show(data);
_magnifier_move(data);
if ((wd->api) && (wd->api->obj_hidemenu))
wd->api->obj_hidemenu(data);
- _magnifier_create(data);
- _magnifier_move(data);
- _magnifier_show(data);
+ if (wd->magnifier_enabled)
+ {
+ _magnifier_create(data);
+ _magnifier_move(data);
+ _magnifier_show(data);
+ }
}
static void
static void
_signal_handler_moving(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
- _magnifier_move(data);
- _magnifier_show(data);
+ Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return;
+
+ if (wd->magnifier_enabled)
+ {
+ _magnifier_move(data);
+ _magnifier_show(data);
+ }
}
static Evas_Coord_Rectangle
!strcmp(elm_widget_type_get(parent_obj), "genlist"))
{
evas_object_geometry_get(parent_obj, &geometry.x, &geometry.y, &geometry.w, &geometry.h);
- if (ret_rect.w == -1 && ret_rect.h == -1) ret_rect = geometry;
+ if ((ret_rect.w == -1) && (ret_rect.h == -1)) ret_rect = geometry;
ret_rect = _intersection_region_get(geometry, ret_rect);
}
}
static void
_signal_selection_end(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
- _magnifier_hide(data);
+ Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return;
+
+ if (wd->magnifier_enabled)
+ _magnifier_hide(data);
_menu_press(data);
}
wd->editable = EINA_TRUE;
wd->disabled = EINA_FALSE;
wd->context_menu = EINA_TRUE;
+ wd->magnifier_enabled = EINA_TRUE;
wd->autosave = EINA_TRUE;
wd->cnp_mode = ELM_CNP_MODE_MARKUP;
wd->autoperiod = EINA_TRUE;
ext_mod->cnpinit = _cnpinit;
ext_mod->context_menu = wd->context_menu;
ext_mod->cnp_mode = wd->cnp_mode;
+ ext_mod->viewport_rect = _viewport_region_get(obj);
}
EAPI void
}
EAPI void
+elm_entry_magnifier_disabled_set(Evas_Object *obj, Eina_Bool disabled)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ if (wd->magnifier_enabled == !disabled) return;
+ wd->magnifier_enabled = !disabled;
+}
+
+EAPI Eina_Bool
+elm_entry_magnifier_disabled_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->magnifier_enabled;
+}
+
+EAPI void
elm_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
{
ELM_CHECK_WIDTYPE(obj, widtype);
}
else
{
- if (ext_mod->viewport_obj)
+ if (ext_mod->viewport_rect.x != -1 || ext_mod->viewport_rect.y != -1
+ || ext_mod->viewport_rect.w != -1 || ext_mod->viewport_rect.h != -1)
{
Evas_Coord vx, vy, vw, vh, x2, y2;
x2 = x + w;
y2 = y + h;
- evas_object_geometry_get(ext_mod->viewport_obj, &vx, &vy, &vw, &vh);
+ vx = ext_mod->viewport_rect.x;
+ vy = ext_mod->viewport_rect.y;
+ vw = ext_mod->viewport_rect.w;
+ vh = ext_mod->viewport_rect.h;
+
if (x < vx) x = vx;
if (y < vy) y = vy;
if (x2 > vx + vw) x2 = vx + vw;
w = x2 - x;
h = y2 - y;
}
+ else
+ {
+ Evas_Coord sw, sh, x2, y2;
+ x2 = x + w;
+ y2 = y + h;
+ ecore_x_window_size_get(ecore_x_window_root_first_get(), &sw, &sh);
+
+ if (x < 0) x = 0;
+ if (y < 0) y = 0;
+ if (x2 > sw) x2 = sw;
+ if (y2 > sh) y2 = sh;
+ w = x2 - x;
+ h = y2 - y;
+ }
cx = x + (w / 2);
cy = y + (h / 2);
evas_object_move(ext_mod->popup, cx, cy);