summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-08-05 13:03:21 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-06 09:26:36 +0200
commit067d65361e3b2c6d992b59fddb373569839ddc60 (patch)
tree88177ce3c8ed93f1f897ef3fe1337e413987799a
parent8f8e19df2016ef54aa07b301ae91fa808ab15d87 (diff)
efl_ui/text: handle disabled text
no idea what's going on here with new styling but this makes it look like it should ref T6649 Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9502
-rw-r--r--data/elementary/themes/edc/efl/text.edc1
-rw-r--r--src/lib/elementary/efl_ui_text.c17
2 files changed, 15 insertions, 3 deletions
diff --git a/data/elementary/themes/edc/efl/text.edc b/data/elementary/themes/edc/efl/text.edc
index 90d260a784..bdae8ff733 100644
--- a/data/elementary/themes/edc/efl/text.edc
+++ b/data/elementary/themes/edc/efl/text.edc
@@ -522,6 +522,7 @@ group { "efl/text";
522 item: "font.name" "Sans"; 522 item: "font.name" "Sans";
523 item: "font.size" "10"; 523 item: "font.size" "10";
524 item: "style.color" "#fff"; 524 item: "style.color" "#fff";
525 item: "style.color_disabled" "#151515";
525 526
526 item: "guide.font.name" "Sans"; 527 item: "guide.font.name" "Sans";
527 item: "guide.font.size" "10"; 528 item: "guide.font.size" "10";
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index 3adfade9c3..6c8a24d36a 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -249,6 +249,7 @@ static void _clear_text_selection(Efl_Ui_Text_Data *sd);
249static void _anchors_free(Efl_Ui_Text_Data *sd); 249static void _anchors_free(Efl_Ui_Text_Data *sd);
250static void _selection_defer(Eo *obj, Efl_Ui_Text_Data *sd); 250static void _selection_defer(Eo *obj, Efl_Ui_Text_Data *sd);
251static Eina_Position2D _decoration_calc_offset(Efl_Ui_Text_Data *sd); 251static Eina_Position2D _decoration_calc_offset(Efl_Ui_Text_Data *sd);
252static void _update_text_theme(Eo *obj, Efl_Ui_Text_Data *sd);
252 253
253static char * 254static char *
254_file_load(Eo *obj) 255_file_load(Eo *obj)
@@ -729,6 +730,7 @@ _efl_ui_text_efl_ui_widget_disabled_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Bool
729 _dnd_pos_cb, NULL, 730 _dnd_pos_cb, NULL,
730 _dnd_drop_cb, NULL); 731 _dnd_drop_cb, NULL);
731 } 732 }
733 _update_text_theme(obj, sd);
732} 734}
733 735
734/* we can't issue the layout's theming code here, cause it assumes an 736/* we can't issue the layout's theming code here, cause it assumes an
@@ -2054,12 +2056,14 @@ _update_text_theme(Eo *obj, Efl_Ui_Text_Data *sd)
2054{ 2056{
2055 const char *font_name; 2057 const char *font_name;
2056 const char *font_size; 2058 const char *font_size;
2057 const char *colorcode; 2059 const char *colorcode = NULL;
2060 Eina_Bool disabled;
2058 2061
2059 int font_size_n; 2062 int font_size_n;
2060 unsigned char r, g, b, a; 2063 unsigned char r, g, b, a;
2061 2064
2062 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 2065 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
2066 disabled = efl_ui_widget_disabled_get(obj);
2063 2067
2064 // Main Text 2068 // Main Text
2065 // font_set 2069 // font_set
@@ -2069,7 +2073,10 @@ _update_text_theme(Eo *obj, Efl_Ui_Text_Data *sd)
2069 efl_text_font_set(sd->text_obj, font_name, font_size_n); 2073 efl_text_font_set(sd->text_obj, font_name, font_size_n);
2070 2074
2071 // color 2075 // color
2072 colorcode = edje_object_data_get(wd->resize_obj, "style.color"); 2076 if (disabled)
2077 colorcode = edje_object_data_get(wd->resize_obj, "style.color_disabled");
2078 if (!colorcode)
2079 colorcode = edje_object_data_get(wd->resize_obj, "style.color");
2073 if (colorcode && _format_color_parse(colorcode, strlen(colorcode), &r, &g, &b, &a)) 2080 if (colorcode && _format_color_parse(colorcode, strlen(colorcode), &r, &g, &b, &a))
2074 { 2081 {
2075 efl_text_normal_color_set(sd->text_obj, r, g, b, a); 2082 efl_text_normal_color_set(sd->text_obj, r, g, b, a);
@@ -2081,8 +2088,12 @@ _update_text_theme(Eo *obj, Efl_Ui_Text_Data *sd)
2081 font_size_n = font_size ? atoi(font_size) : 0; 2088 font_size_n = font_size ? atoi(font_size) : 0;
2082 efl_text_font_set(sd->text_guide_obj, font_name, font_size_n); 2089 efl_text_font_set(sd->text_guide_obj, font_name, font_size_n);
2083 2090
2091 colorcode = NULL;
2084 // color 2092 // color
2085 colorcode = edje_object_data_get(wd->resize_obj, "guide.style.color"); 2093 if (disabled)
2094 colorcode = edje_object_data_get(wd->resize_obj, "guide.style.color_disabled");
2095 if (!colorcode)
2096 colorcode = edje_object_data_get(wd->resize_obj, "guide.style.color");
2086 if (colorcode && _format_color_parse(colorcode, strlen(colorcode), &r, &g, &b, &a)) 2097 if (colorcode && _format_color_parse(colorcode, strlen(colorcode), &r, &g, &b, &a))
2087 { 2098 {
2088 efl_text_normal_color_set(sd->text_guide_obj, r, g, b, a); 2099 efl_text_normal_color_set(sd->text_guide_obj, r, g, b, a);