summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hirt <daniel.hirt@samsung.com>2016-03-09 16:19:06 +0200
committerDaniel Hirt <daniel.hirt@samsung.com>2016-03-15 11:33:19 +0200
commit703e0da8a20b0ca1855612211128e6e4002059a1 (patch)
treef075662ef50b36374c0661e144cae793e6439797
parente7e6e4e1ceea50cc4787e7110b553da6415fbf5c (diff)
Label: merge with Entry, cont.
- line_wrap moved to elm_obj_entry_line_wrap (remains legacy EAPI in label) - removed unused _recalc in label
-rw-r--r--src/lib/elm_label.c55
-rw-r--r--src/lib/elm_label.eo16
2 files changed, 12 insertions, 59 deletions
diff --git a/src/lib/elm_label.c b/src/lib/elm_label.c
index 16b6293f8..2d0d0c9ae 100644
--- a/src/lib/elm_label.c
+++ b/src/lib/elm_label.c
@@ -31,43 +31,6 @@ static const Elm_Layout_Part_Alias_Description _text_aliases[] =
31}; 31};
32 32
33static void 33static void
34_recalc(void *data)
35{
36 ELM_LABEL_DATA_GET(data, sd);
37 ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
38
39 Evas_Coord minw = -1, minh = -1;
40 Evas_Coord resw, w;
41
42 evas_event_freeze(evas_object_evas_get(data));
43 edje_object_size_min_calc(wd->resize_obj, &minw, NULL);
44 evas_object_geometry_get(wd->resize_obj, NULL, NULL, &w, NULL);
45
46 if (sd->wrap_w > minw)
47 resw = sd->wrap_w;
48 else if ((sd->wrap_w > 0) && (minw > sd->wrap_w))
49 resw = minw;
50 else
51 resw = w;
52 edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, resw, 0);
53
54 /* This is a hack to workaround the way min size hints are treated.
55 * If the minimum width is smaller than the restricted width, it means
56 * the minimum doesn't matter. */
57 if ((minw <= resw) && (minw != sd->wrap_w))
58 {
59 Evas_Coord ominw = -1;
60
61 evas_object_size_hint_min_get(data, &ominw, NULL);
62 minw = ominw;
63 }
64
65 evas_object_size_hint_min_set(data, minw, minh);
66 evas_event_thaw(evas_object_evas_get(data));
67 evas_event_thaw_eval(evas_object_evas_get(data));
68}
69
70static void
71_label_format_set(Evas_Object *obj, const char *format) 34_label_format_set(Evas_Object *obj, const char *format)
72{ 35{
73 if (format) 36 if (format)
@@ -378,12 +341,6 @@ _elm_label_eo_base_finalize(Eo *obj, Elm_Label_Data *_pd EINA_UNUSED)
378 return obj; 341 return obj;
379} 342}
380 343
381EOLIAN static Elm_Wrap_Type
382_elm_label_line_wrap_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
383{
384 return sd->linewrap;
385}
386
387EOLIAN static void 344EOLIAN static void
388_elm_label_wrap_width_set(Eo *obj, Elm_Label_Data *sd, Evas_Coord w) 345_elm_label_wrap_width_set(Eo *obj, Elm_Label_Data *sd, Evas_Coord w)
389{ 346{
@@ -458,6 +415,18 @@ _elm_label_slide_mode_get(Eo *obj EINA_UNUSED, Elm_Label_Data *sd)
458 return sd->slide_mode; 415 return sd->slide_mode;
459} 416}
460 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
461EINA_DEPRECATED EAPI void 430EINA_DEPRECATED EAPI void
462elm_label_slide_set(Evas_Object *obj, Eina_Bool slide) 431elm_label_slide_set(Evas_Object *obj, Eina_Bool slide)
463{ 432{
diff --git a/src/lib/elm_label.eo b/src/lib/elm_label.eo
index 23e5a7662..0f3a1db55 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 line_wrap {
84 [[Control the wrapping behavior of the label
85
86 By default no wrapping is done. Possible values for $wrap are:
87 $ELM_WRAP_NONE - No wrapping
88 $ELM_WRAP_CHAR - wrap between characters
89 $ELM_WRAP_WORD - wrap between words
90 $ELM_WRAP_MIXED - Word wrap, and if that fails, char wrap]]
91 set {
92 }
93 get {
94 }
95 values {
96 wrap: Elm.Wrap.Type; [[To wrap text or not]]
97 }
98 }
99 @property ellipsis { 83 @property ellipsis {
100 [[Control the ellipsis behavior of the label 84 [[Control the ellipsis behavior of the label
101 85