summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-11-18 06:05:24 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-11-18 06:05:24 +0900
commita10d87a326b437f6b5c8b597aabe2eab215c7ad7 (patch)
tree5bdf71e1e850df8c9ac3a149b8a9b72ce3656a1a
parent423f65d114065941a722fd32bb8a88cfecc7641b (diff)
file preview text display - calculate minimum size so alignment is ok
this fixes T444 - the display of text is properly top-left aligned with scrollbars now actually correct too for the text provided (note that the preview doesnt put ALL text in there. just the first N bytes which by default is 2048 but can be changed).
-rw-r--r--src/bin/e_widget_filepreview.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bin/e_widget_filepreview.c b/src/bin/e_widget_filepreview.c
index 48c1539b8..e7011c3d2 100644
--- a/src/bin/e_widget_filepreview.c
+++ b/src/bin/e_widget_filepreview.c
@@ -914,12 +914,15 @@ _e_wid_fprev_preview_txt_read_notify(void *data, Ecore_Thread *eth __UNUSED__, v
914{ 914{
915 E_Widget_Data *wd = data; 915 E_Widget_Data *wd = data;
916 char *buf; 916 char *buf;
917 917 Evas_Coord mw, mh;
918
918 //INF("text='%s'", (char*)msg); 919 //INF("text='%s'", (char*)msg);
919 buf = alloca(strlen(msg) + 4096); 920 buf = alloca(strlen(msg) + 4096);
920 strcpy(buf, "<align=left>"); 921 strcpy(buf, "<align=left>");
921 strcat(buf, msg); 922 strcat(buf, msg);
922 edje_object_part_text_set(wd->o_preview_preview, "e.textblock.message", buf); 923 edje_object_part_text_set(wd->o_preview_preview, "e.textblock.message", buf);
924 edje_object_size_min_calc(wd->o_preview_preview, &mw, &mh);
925 evas_object_resize(wd->o_preview_preview, mw, mh);
923 free(msg); 926 free(msg);
924} 927}
925 928
@@ -957,7 +960,7 @@ _e_wid_fprev_preview_txt(E_Widget_Data *wd)
957 if (!wd->o_preview_preview) 960 if (!wd->o_preview_preview)
958 { 961 {
959 Evas *evas; 962 Evas *evas;
960 963
961 evas = evas_object_evas_get(wd->obj); 964 evas = evas_object_evas_get(wd->obj);
962 o = edje_object_add(evas); 965 o = edje_object_add(evas);
963 /* using dialog theme for now because it's simple, common, and doesn't require all 966 /* using dialog theme for now because it's simple, common, and doesn't require all