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)
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
86 const char *hover_style; /**< style of a hover object */ 86 const char *hover_style; /**< style of a hover object */
87 } anchor_hover; 87 } anchor_hover;
88 88
89 Elm_Cnp_Mode cnp_mode; 89 Elm_Sel_Format cnp_mode;
90 Elm_Sel_Format drop_format; 90 Elm_Sel_Format drop_format;
91 91
92 struct { 92 struct {
@@ -1989,7 +1989,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
1989 efl_composite_attach(obj, text_obj); 1989 efl_composite_attach(obj, text_obj);
1990 1990
1991 sd->entry_edje = wd->resize_obj; 1991 sd->entry_edje = wd->resize_obj;
1992 sd->cnp_mode = ELM_CNP_MODE_PLAINTEXT; 1992 sd->cnp_mode = EFL_SELECTION_FORMAT_TEXT;
1993 sd->line_wrap = ELM_WRAP_WORD; 1993 sd->line_wrap = ELM_WRAP_WORD;
1994 sd->context_menu = EINA_TRUE; 1994 sd->context_menu = EINA_TRUE;
1995 sd->auto_save = EINA_TRUE; 1995 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,
2394EOLIAN static void 2394EOLIAN static void
2395_efl_ui_text_cnp_mode_set(Eo *obj, Efl_Ui_Text_Data *sd, Efl_Selection_Format cnp_mode) 2395_efl_ui_text_cnp_mode_set(Eo *obj, Efl_Ui_Text_Data *sd, Efl_Selection_Format cnp_mode)
2396{ 2396{
2397 /* FIXME: CnP format handling really odd... */
2398
2399 Elm_Sel_Format dnd_format = EFL_SELECTION_FORMAT_MARKUP; 2397 Elm_Sel_Format dnd_format = EFL_SELECTION_FORMAT_MARKUP;
2400 Elm_Sel_Format cnp_format = cnp_mode;
2401 2398
2402 if (cnp_mode != EFL_SELECTION_FORMAT_TARGETS) 2399 if (cnp_mode != EFL_SELECTION_FORMAT_TARGETS)
2403 { 2400 {
@@ -2409,8 +2406,8 @@ _efl_ui_text_cnp_mode_set(Eo *obj, Efl_Ui_Text_Data *sd, Efl_Selection_Format cn
2409 cnp_mode &= ~EFL_SELECTION_FORMAT_HTML; 2406 cnp_mode &= ~EFL_SELECTION_FORMAT_HTML;
2410 } 2407 }
2411 2408
2412 if (sd->cnp_mode == cnp_format) return; 2409 if (sd->cnp_mode == cnp_mode) return;
2413 sd->cnp_mode = cnp_format; 2410 sd->cnp_mode = cnp_mode;
2414 if (sd->cnp_mode == EFL_SELECTION_FORMAT_TEXT) 2411 if (sd->cnp_mode == EFL_SELECTION_FORMAT_TEXT)
2415 dnd_format = EFL_SELECTION_FORMAT_TEXT; 2412 dnd_format = EFL_SELECTION_FORMAT_TEXT;
2416 else if (cnp_mode == EFL_SELECTION_FORMAT_IMAGE) 2413 else if (cnp_mode == EFL_SELECTION_FORMAT_IMAGE)