summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hirt <daniel.hirt@samsung.com>2016-03-09 17:00:59 +0200
committerDaniel Hirt <daniel.hirt@samsung.com>2016-03-15 11:33:19 +0200
commit9e2ddfe118d70782af75362575063ea6e5e7bc4b (patch)
treed6fedf0ddd95667d681ab022fecb79955f4cd74c
parent703e0da8a20b0ca1855612211128e6e4002059a1 (diff)
Label: merge with entry, cont.
- Move line_wrap API to legacy - Move ellipsis_set API to legacy
-rw-r--r--src/lib/elm_label.c63
-rw-r--r--src/lib/elm_label.eo16
-rw-r--r--src/lib/elm_label_legacy.h4
3 files changed, 34 insertions, 49 deletions
diff --git a/src/lib/elm_label.c b/src/lib/elm_label.c
index 2d0d0c9ae..53979b4ce 100644
--- a/src/lib/elm_label.c
+++ b/src/lib/elm_label.c
@@ -34,9 +34,9 @@ static void
34_label_format_set(Evas_Object *obj, const char *format) 34_label_format_set(Evas_Object *obj, const char *format)
35{ 35{
36 if (format) 36 if (format)
37 edje_object_part_text_style_user_push(obj, "elm.text", format); 37 elm_entry_text_style_user_push(obj, format);
38 else 38 else
39 edje_object_part_text_style_user_pop(obj, "elm.text"); 39 elm_entry_text_style_user_pop(obj);
40} 40}
41 41
42static void 42static void
@@ -275,7 +275,7 @@ _on_slide_end(void *data, Evas_Object *obj EINA_UNUSED,
275 ELM_LABEL_DATA_GET(data, sd); 275 ELM_LABEL_DATA_GET(data, sd);
276 276
277 if (sd->slide_ellipsis) 277 if (sd->slide_ellipsis)
278 elm_obj_label_ellipsis_set(data, EINA_TRUE); 278 elm_label_ellipsis_set(data, EINA_TRUE);
279 279
280 eo_event_callback_call(data, ELM_LABEL_EVENT_SLIDE_END, NULL); 280 eo_event_callback_call(data, ELM_LABEL_EVENT_SLIDE_END, NULL);
281} 281}
@@ -365,12 +365,38 @@ _elm_label_wrap_width_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
365} 365}
366 366
367EOLIAN static void 367EOLIAN static void
368_elm_label_ellipsis_set(Eo *obj, Elm_Label_Data *sd, Eina_Bool ellipsis) 368_elm_label_slide_mode_set(Eo *obj EINA_UNUSED, Elm_Label_Data *sd, Elm_Label_Slide_Mode mode)
369{
370 sd->slide_mode = mode;
371}
372
373EOLIAN static Elm_Label_Slide_Mode
374_elm_label_slide_mode_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
375{
376 return sd->slide_mode;
377}
378
379EAPI void
380elm_label_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap)
381{
382 elm_obj_entry_line_wrap_set(eo_super(obj, MY_CLASS), wrap);
383}
384
385EAPI Elm_Wrap_Type
386elm_label_line_wrap_get(const Evas_Object *obj)
387{
388 return elm_obj_entry_line_wrap_get(eo_super(obj, MY_CLASS));
389}
390
391EAPI void
392elm_label_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis)
369{ 393{
370 Eina_Strbuf *fontbuf = NULL; 394 Eina_Strbuf *fontbuf = NULL;
371 int len, removeflag = 0; 395 int len, removeflag = 0;
372 const char *text; 396 const char *text;
373 397
398 ELM_LABEL_DATA_GET(obj, sd);
399
374 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 400 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
375 401
376 if (sd->ellipsis == ellipsis) return; 402 if (sd->ellipsis == ellipsis) return;
@@ -397,35 +423,6 @@ _elm_label_ellipsis_set(Eo *obj, Elm_Label_Data *sd, Eina_Bool ellipsis)
397 eina_strbuf_free(fontbuf); 423 eina_strbuf_free(fontbuf);
398} 424}
399 425
400EOLIAN static Eina_Bool
401_elm_label_ellipsis_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
402{
403 return sd->ellipsis;
404}
405
406EOLIAN static void
407_elm_label_slide_mode_set(Eo *obj EINA_UNUSED, Elm_Label_Data *sd, Elm_Label_Slide_Mode mode)
408{
409 sd->slide_mode = mode;
410}
411
412EOLIAN static Elm_Label_Slide_Mode
413_elm_label_slide_mode_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
414{
415 return sd->slide_mode;
416}
417
418EAPI void
419elm_label_line_wrap_set(const Evas_Object *obj, Elm_Wrap_Type wrap)
420{
421 elm_obj_entry_line_wrap_set(eo_super(obj, MY_CLASS), wrap);
422}
423
424EAPI Elm_Wrap_Type
425elm_label_line_wrap_get(const Evas_Object *obj)
426{
427 return elm_obj_entry_line_wrap_get(eo_super(obj, MY_CLASS));
428}
429 426
430EINA_DEPRECATED EAPI void 427EINA_DEPRECATED EAPI void
431elm_label_slide_set(Evas_Object *obj, Eina_Bool slide) 428elm_label_slide_set(Evas_Object *obj, Eina_Bool slide)
diff --git a/src/lib/elm_label.eo b/src/lib/elm_label.eo
index 0f3a1db55..969bbd2f1 100644
--- a/src/lib/elm_label.eo
+++ b/src/lib/elm_label.eo
@@ -80,22 +80,6 @@ class Elm.Label (Elm.Entry)
80 duration: double; [[The duration in seconds in moving text from slide begin position to slide end position]] 80 duration: double; [[The duration in seconds in moving text from slide begin position to slide end position]]
81 } 81 }
82 } 82 }
83 @property ellipsis {
84 [[Control the ellipsis behavior of the label
85
86 If set to true and the text doesn't fit in the label an ellipsis("...")
87 will be shown at the end of the widget.
88
89 Warning This doesn't work with slide(elm_label_slide_set()) or if the
90 chosen wrap method was $ELM_WRAP_WORD.]]
91 set {
92 }
93 get {
94 }
95 values {
96 ellipsis: bool; [[To ellipsis text or not]]
97 }
98 }
99 slide_go { 83 slide_go {
100 [[Start slide effect. 84 [[Start slide effect.
101 85
diff --git a/src/lib/elm_label_legacy.h b/src/lib/elm_label_legacy.h
index dd48b8235..088c8c393 100644
--- a/src/lib/elm_label_legacy.h
+++ b/src/lib/elm_label_legacy.h
@@ -7,5 +7,9 @@
7 * @ingroup Label 7 * @ingroup Label
8 */ 8 */
9EAPI Evas_Object *elm_label_add(Evas_Object *parent); 9EAPI Evas_Object *elm_label_add(Evas_Object *parent);
10EAPI void elm_label_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap);
11EAPI Elm_Wrap_Type elm_label_line_wrap_get(const Evas_Object *obj);
12EAPI void elm_label_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis);
13EAPI Eina_Bool elm_label_ellipsis_get(const Evas_Object *obj);
10 14
11#include "elm_label.eo.legacy.h" 15#include "elm_label.eo.legacy.h"