rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=8a945416ee7dfda72788f7b39598b8169cdbc9ba

commit 8a945416ee7dfda72788f7b39598b8169cdbc9ba
Author: Vitalii Vorobiov <[email protected]>
Date:   Fri Jul 15 15:05:24 2016 +0300

    property_textblock: use single lined text for cases when ellipsis is on
    
    @fix
---
 src/bin/common/common_macro.h            | 17 +++++++++++++++++
 src/bin/ui/property/property_textblock.c | 23 +++++++----------------
 src/bin/ui/style_manager.c               | 14 --------------
 3 files changed, 24 insertions(+), 30 deletions(-)

diff --git a/src/bin/common/common_macro.h b/src/bin/common/common_macro.h
index 458b70f..22041f6 100644
--- a/src/bin/common/common_macro.h
+++ b/src/bin/common/common_macro.h
@@ -122,5 +122,22 @@ _##_gen##_item_search(Evas_Object *obj, \
    search_data->last_item_found = last_item_found; \
 }
 
+#define TEST_TEXT \
+"<\t>By the time London returned home, his stepfather had died." \
+"It then became his responsibility to provide for his family all by himself." \
+"Desperate for a job, he spent entire days walking around the Oakland business 
district." \
+"Occasionally he found a temporary job. He pawned his watch, bicycle," \
+"Mackintosh, and started writing again.<br/>" \
+"<\t>He carefully studied different stories published in magazines," \
+"trying to learn the secret of their popularity." \
+"He referred to the works of famous writers." \
+"By reading many of them he learned about the craft of constructing a plot," \
+"about creating a particular style. Rudyard Kipling captured his attention." \
+"He reached the conclusion that to write well he needed to write concisely" \
+"and he needed to tell about strong human emotions and vivid characters.<br/>" 
\
+"(c) Jack London. THE NORTHERN TALES. (NEW BATTLES. CHAPTER 5)"
+
+#define TEST_TEXT_SINGLE \
+"Six big devils from Japan quickly forgot how to waltz."
 
 #endif /* COMMON_MACRO_H */
diff --git a/src/bin/ui/property/property_textblock.c 
b/src/bin/ui/property/property_textblock.c
index 91088e9..664b9e7 100644
--- a/src/bin/ui/property/property_textblock.c
+++ b/src/bin/ui/property/property_textblock.c
@@ -391,7 +391,10 @@ _update_style()
         str_tmp = eina_stringshare_printf("%f", (double)tpd.ellipsis_value / 
100);
         eina_strbuf_append(tag, str_tmp);
         eina_stringshare_del(str_tmp);
+        
evas_object_textblock_text_markup_set(tpd.current_style.textblock_style, 
TEST_TEXT_SINGLE);
      }
+   else
+     evas_object_textblock_text_markup_set(tpd.current_style.textblock_style, 
TEST_TEXT);
 
    edje_edit_style_tag_value_set(ap.project->global_object, 
tpd.current_style.st_name,
                                  tpd.current_style.st_tag, 
eina_strbuf_string_get(tag));
@@ -656,10 +659,6 @@ _change_cb(Property_Attribute *pa, Property_Action *action)
          break;
       case ATTRIBUTE_TEXTBLOCK_ITEM_FORMAT_ELLIPSIS_CHECK:
          tpd.ellipsis_check = bool_val1;
-         if (!bool_val1)
-           tpd.ellipsis_value = -100;
-         else
-           tpd.ellipsis_value = 0;
          _style_edit_update();
          CRIT_ON_FAIL(editor_save(ap.project->global_object));
          ap.project->changed = true;
@@ -861,8 +860,8 @@ _update_cb(Property_Attribute *pa, Property_Action *action)
          elm_check_state_set(action->control, tpd.ellipsis_check);
          break;
       case ATTRIBUTE_TEXTBLOCK_ITEM_FORMAT_ELLIPSIS_VALUE:
-         elm_object_disabled_set(action->control, !tpd.ellipsis_check);
          elm_spinner_value_set(action->control, tpd.ellipsis_value);
+         elm_object_disabled_set(action->control, !tpd.ellipsis_check);
          break;
       case ATTRIBUTE_TEXTBLOCK_ITEM_FORMAT_LINE_RELATED_SIZE:
          elm_spinner_value_set(action->control, tpd.linerelsize);
@@ -1001,9 +1000,7 @@ _init_cb(Property_Attribute *pa, Property_Action *action)
          _fill_combobox_with_enum(action->control, text_wrap);
          break;
       case ATTRIBUTE_TEXTBLOCK_ITEM_FORMAT_ELLIPSIS_VALUE:
-         /* because ellipsis SIGSEV on a lot of values sadly... */
          elm_spinner_min_max_set(action->control, 0, 100);
-         elm_spinner_step_set(action->control, 50);
          break;
       case ATTRIBUTE_TEXTBLOCK_ITEM_GLOW_SHADOW_STYLE:
          _fill_combobox_with_enum(action->control, font_glow_list);
@@ -1458,18 +1455,12 @@ _on_style_selected(void *data,
 
         tmp = _tag_value_get(value, "ellipsis");
         if (!tmp) tmp = eina_tmpstr_add("0");
+        else tpd.ellipsis_check = true;
         tpd.ellipsis_value = atof(tmp);
         eina_tmpstr_del(tmp);
 
-        tmp = _tag_value_get(value, "check_ellipsis");
-        if ((!tmp) || (!strcmp(tmp, "off")))
-          {
-             tpd.ellipsis_value = -100;
-             tpd.ellipsis_check = false;
-          }
-        else
-          tpd.ellipsis_check = true;
-        eina_tmpstr_del(tmp);
+        
evas_object_textblock_text_markup_set(tpd.current_style.textblock_style,
+                                              (tpd.ellipsis_check) ? 
TEST_TEXT_SINGLE : TEST_TEXT);
 
         tmp = _tag_value_get(value, "linerelsize");
         if (!tmp) tmp = eina_tmpstr_add("0");
diff --git a/src/bin/ui/style_manager.c b/src/bin/ui/style_manager.c
index ddfceac..b1bdc1a 100644
--- a/src/bin/ui/style_manager.c
+++ b/src/bin/ui/style_manager.c
@@ -27,20 +27,6 @@
 
 #define STYLE_DEFAULT         "DEFAULT"
 #define STYLE_DEFAULT_VALUE "align=middle font=Sans font_size=24 color=#000000 
"
-#define TEST_TEXT \
-"<\t>By the time London returned home, his stepfather had died." \
-"It then became his responsibility to provide for his family all by himself." \
-"Desperate for a job, he spent entire days walking around the Oakland business 
district." \
-"Occasionally he found a temporary job. He pawned his watch, bicycle," \
-"Mackintosh, and started writing again.<br/>" \
-"<\t>He carefully studied different stories published in magazines," \
-"trying to learn the secret of their popularity." \
-"He referred to the works of famous writers." \
-"By reading many of them he learned about the craft of constructing a plot," \
-"about creating a particular style. Rudyard Kipling captured his attention." \
-"He reached the conclusion that to write well he needed to write concisely" \
-"and he needed to tell about strong human emotions and vivid characters.<br/>" 
\
-"(c) Jack London. THE NORTHERN TALES. (NEW BATTLES. CHAPTER 5)"
 
 typedef struct _Style_Tag_Entries Style_Tag_Entries;
 typedef struct _Style_entries Style_Entries;

-- 


Reply via email to