Enlightenment CVS committal

Author  : dj2
Project : misc
Module  : eke

Dir     : misc/eke/src


Modified Files:
        eke_gui_edje_item.c 


Log Message:
- show/hide the scrollbars on the text body if required

===================================================================
RCS file: /cvsroot/enlightenment/misc/eke/src/eke_gui_edje_item.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- eke_gui_edje_item.c 30 Dec 2004 21:21:45 -0000      1.6
+++ eke_gui_edje_item.c 31 Dec 2004 00:16:00 -0000      1.7
@@ -108,15 +108,14 @@
         if(body) {
             Evas_Object *desc, *container;
             Etox_Context *ctx;
-            Evas_Coord w, h;
+            Evas_Coord w, h, ew, eh;
             Evas *evas;
            
             evas = evas_object_evas_get(o);
 
-            if((desc = edje_object_part_swallow_get(data->obj, "body"))) 
-            {
+            if ((desc = edje_object_part_swallow_get(data->obj, "body"))) 
                 evas_object_del(desc);
-            }
+            
             desc = etox_new(evas);
             ctx = etox_get_context(desc);
             etox_context_set_color(ctx, 0, 0, 0, 255);
@@ -143,9 +142,15 @@
             edje_object_part_geometry_get(data->obj, "body", NULL, NULL, &w, 
&h);
             evas_object_resize(desc, w, h);
 
-            esmart_container_element_append(container, desc);
             edje_object_part_swallow(data->obj, "body", container);
 
+            /* hide the scrollbar if we have less text then visible space */
+            etox_text_geometry_get(desc, &ew, &eh);
+            if (eh <= h)
+                edje_object_signal_emit(data->obj, "body,scroll,hide", "");
+
+            esmart_container_element_append(container, desc);
+
             edje_object_signal_callback_add(data->obj, "drag",
                                     "feed.body.item.scroll",
                                     eke_gui_edje_item_feed_container_scroll_cb,
@@ -388,7 +393,22 @@
 
   if((data = evas_object_smart_data_get(o)))
   {
+    Evas_List *list;
+    Evas_Object *etox, *container;;
+    Evas_Coord eh, ph;
+   
     evas_object_resize(data->obj, w, h);
+    edje_object_part_geometry_get(data->obj, "body", NULL, NULL, NULL, &ph);
+
+    container = edje_object_part_swallow_get(data->obj, "body");
+    list = esmart_container_elements_get(container);
+    etox = evas_list_nth(list, 0);
+    etox_text_geometry_get(etox, NULL, &eh);
+
+    if (eh > ph)
+        edje_object_signal_emit(data->obj, "body,scroll,show", "");
+    else
+        edje_object_signal_emit(data->obj, "body,scroll,hide", "");
   }
 }
 




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to