summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-11-08 17:12:35 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-11-09 12:18:59 +0000
commitc490c711196e551973ae8dbb57a0588da5b3ccd6 (patch)
treeb5b0ead2e2c945897b56444dc9b0f1e8446191eb
parentb05472eb9d05ac659c1657eefabdfc1aeed4e3bb (diff)
downloadefl-c490c711196e551973ae8dbb57a0588da5b3ccd6.tar.gz
efl ui text - stop being brain damaged with cnp mode
cnp mode type was a mess. thankfully it was a bit simpler than it seemed. cleaned up code to deal with it sanely and keep it a single type as intended byt he api too.
-rw-r--r--src/lib/elementary/efl_ui_text.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index ece5d39830..9825e98eb6 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -86,7 +86,7 @@ struct _Efl_Ui_Text_Data
const char *hover_style; /**< style of a hover object */
} anchor_hover;
- Elm_Cnp_Mode cnp_mode;
+ Elm_Sel_Format cnp_mode;
Elm_Sel_Format drop_format;
struct {
@@ -1989,7 +1989,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
efl_composite_attach(obj, text_obj);
sd->entry_edje = wd->resize_obj;
- sd->cnp_mode = ELM_CNP_MODE_PLAINTEXT;
+ sd->cnp_mode = EFL_SELECTION_FORMAT_TEXT;
sd->line_wrap = ELM_WRAP_WORD;
sd->context_menu = EINA_TRUE;
sd->auto_save = EINA_TRUE;
@@ -2394,10 +2394,7 @@ _efl_ui_text_efl_file_file_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd,
EOLIAN static void
_efl_ui_text_cnp_mode_set(Eo *obj, Efl_Ui_Text_Data *sd, Efl_Selection_Format cnp_mode)
{
- /* FIXME: CnP format handling really odd... */
-
Elm_Sel_Format dnd_format = EFL_SELECTION_FORMAT_MARKUP;
- Elm_Sel_Format cnp_format = cnp_mode;
if (cnp_mode != EFL_SELECTION_FORMAT_TARGETS)
{
@@ -2409,8 +2406,8 @@ _efl_ui_text_cnp_mode_set(Eo *obj, Efl_Ui_Text_Data *sd, Efl_Selection_Format cn
cnp_mode &= ~EFL_SELECTION_FORMAT_HTML;
}
- if (sd->cnp_mode == cnp_format) return;
- sd->cnp_mode = cnp_format;
+ if (sd->cnp_mode == cnp_mode) return;
+ sd->cnp_mode = cnp_mode;
if (sd->cnp_mode == EFL_SELECTION_FORMAT_TEXT)
dnd_format = EFL_SELECTION_FORMAT_TEXT;
else if (cnp_mode == EFL_SELECTION_FORMAT_IMAGE)