summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2015-03-25 07:23:07 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-03-25 07:23:07 +0900
commit906b3361695ac81adcea977f7ee025f6ce906d3a (patch)
treead6e9edaca5c2bbc9de1e18dc15a06acdc0d99c8
parent9cf57e111b66fe8c4e0834cfcd08fc7d6d3b503a (diff)
tooltip: Corrected namespacing for tooltip label style.
Summary: namespacing is wrong for tooltip label. Although we still support old theme but it should be removed in EFL 2.0. Test Plan: elementary_test -to tooltip Reviewers: seoz, Hermet, raster Reviewed By: raster Subscribers: kimcinoo, sachin.dev, seoz Differential Revision: https://phab.enlightenment.org/D2120
-rw-r--r--data/themes/edc/elm/tooltip.edc4
-rw-r--r--src/lib/els_tooltip.c23
2 files changed, 22 insertions, 5 deletions
diff --git a/data/themes/edc/elm/tooltip.edc b/data/themes/edc/elm/tooltip.edc
index 4094b204a..f84e0764e 100644
--- a/data/themes/edc/elm/tooltip.edc
+++ b/data/themes/edc/elm/tooltip.edc
@@ -1,4 +1,6 @@
1group { name: "elm/label/base/tooltip"; 1group { name: "elm/label/base/tooltip/default";
2 alias: "elm/label/base/tooltip"; //XXX: Remove it in EFL 2.0
3 alias: "elm/label/base/tooltip/transparent";
2 styles { 4 styles {
3 style { name: "tooltip_style"; 5 style { name: "tooltip_style";
4 base: "font="FN" font_size=10 color=#ffffff style=shadow,bottom shadow_color=#00000080 wrap=word text_class=bubble"; 6 base: "font="FN" font_size=10 color=#ffffff style=shadow,bottom shadow_color=#00000080 wrap=word text_class=bubble";
diff --git a/src/lib/els_tooltip.c b/src/lib/els_tooltip.c
index 6bf2b6dec..811c69841 100644
--- a/src/lib/els_tooltip.c
+++ b/src/lib/els_tooltip.c
@@ -730,25 +730,40 @@ _elm_tooltip_obj_free_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, voi
730 _elm_tooltip_unset(tt); 730 _elm_tooltip_unset(tt);
731} 731}
732 732
733static void
734_tooltip_label_style_set(Evas_Object *obj, Evas_Object *label)
735{
736 ELM_TOOLTIP_GET_OR_RETURN(tt, obj);
737 char buf[100] = {0};
738
739 sprintf(buf, "tooltip/%s", tt->style);
740 if (!elm_object_style_set(label, buf))
741 {
742 WRN("Failed to set tooltip label style: %s, reverting to old style",
743 buf);
744 elm_object_style_set(label, "tooltip"); //XXX: remove it in EFL 2.0
745 }
746}
747
733static Evas_Object * 748static Evas_Object *
734_elm_tooltip_label_create(void *data, Evas_Object *obj EINA_UNUSED, Evas_Object *tooltip) 749_elm_tooltip_label_create(void *data, Evas_Object *obj, Evas_Object *tooltip)
735{ 750{
736 Evas_Object *label = elm_label_add(tooltip); 751 Evas_Object *label = elm_label_add(tooltip);
737 if (!label) 752 if (!label)
738 return NULL; 753 return NULL;
739 elm_object_style_set(label, "tooltip"); 754 _tooltip_label_style_set(obj, label);
740 elm_object_text_set(label, data); 755 elm_object_text_set(label, data);
741 return label; 756 return label;
742} 757}
743 758
744static Evas_Object * 759static Evas_Object *
745_elm_tooltip_trans_label_create(void *data, Evas_Object *obj EINA_UNUSED, Evas_Object *tooltip) 760_elm_tooltip_trans_label_create(void *data, Evas_Object *obj, Evas_Object *tooltip)
746{ 761{
747 Evas_Object *label = elm_label_add(tooltip); 762 Evas_Object *label = elm_label_add(tooltip);
748 const char **text = data; 763 const char **text = data;
749 if (!label) 764 if (!label)
750 return NULL; 765 return NULL;
751 elm_object_style_set(label, "tooltip"); 766 _tooltip_label_style_set(obj, label);
752 elm_object_domain_translatable_text_set(label, text[0], text[1]); 767 elm_object_domain_translatable_text_set(label, text[0], text[1]);
753 return label; 768 return label;
754} 769}