Enlightenment CVS committal
Author : moom16
Project : e17
Module : proto
Dir : e17/proto/etk/src/lib
Modified Files:
etk_viewport.c
Log Message:
* Center the viewport child if it could fit the allocated space
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_viewport.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- etk_viewport.c 2 Dec 2005 21:57:55 -0000 1.3
+++ etk_viewport.c 22 Dec 2005 10:56:50 -0000 1.4
@@ -101,10 +101,17 @@
Etk_Size child_requisition;
etk_widget_size_request(child, &child_requisition);
-
- etk_widget_size_request(child, &child_requisition);
- geometry.x -= viewport->xscroll;
- geometry.y -= viewport->yscroll;
+
+ if (child_requisition.w <= geometry.w)
+ geometry.x += (geometry.w - child_requisition.w) / 2;
+ else
+ geometry.x -= viewport->xscroll;
+
+ if (child_requisition.h <= geometry.h)
+ geometry.y += (geometry.h - child_requisition.h) / 2;
+ else
+ geometry.y -= viewport->yscroll;
+
geometry.w = child_requisition.w;
geometry.h = child_requisition.h;
etk_widget_size_allocate(child, geometry);
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs