Revision: 3930
          http://vexi.svn.sourceforge.net/vexi/?rev=3930&view=rev
Author:   clrg
Date:     2010-10-20 14:41:12 +0000 (Wed, 20 Oct 2010)

Log Message:
-----------
Make option/combo a bit lighter

Modified Paths:
--------------
    trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/combo.t
    trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/option.t

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/combo.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/combo.t   
2010-10-20 14:06:08 UTC (rev 3929)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/combo.t   
2010-10-20 14:41:12 UTC (rev 3930)
@@ -53,31 +53,17 @@
         $content.contentwidth ++= opt.listwidthWrite;
         $content.contentheight ++= opt.contentheightWrite;
         
-        thisbox.v_container ++= function(v) {
-            cascade = v;
-            v_fillbox = $focus;
-            v_textbox = $edit.v_edit;
-        }
+        thisbox.v_container ++= static.containerWrite;
+        thisbox.surfaceWidth ++= opt.surfaceWidthRead;
+        thisbox.surfaceHeight ++= opt.surfaceHeightRead;
         
-        thisbox.surfaceWidth = function(dx, sw) {
-            v_popbox.surface_x =
-                vexi.math.min(dx+marginleft+1, vexi.math.max(0, 
sw-v_popbox.width));
-        }
-        
-        thisbox.surfaceHeight = function(dy, sh) {
-            var h = v_popbox.height;
-            if (sh>dy+height-marginbottom-2 + h) {
-                // fit below widget
-                v_popbox.surface_y = dy+height-marginbottom-2;
-            } else if (dy-h+marginbottom+2>=0) {
-                // fix above widget
-                v_popbox.surface_y = dy-h+marginbottom+2;
-            } else {
-                // make the most of a bad situation
-                v_popbox.surface_y = vexi.math.max(0, sh-h);
-            }
-        }
-        
     </lib:widget.combo>
     <finalize />
+    
+    static.containerWrite = function(v) {
+        cascade = v;
+        trapee.v_fillbox = trapee.th_focus;
+        trapee.v_textbox = trapee.v_edit;
+    }
+    
 </vexi>

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/option.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/option.t  
2010-10-20 14:06:08 UTC (rev 3929)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/option.t  
2010-10-20 14:41:12 UTC (rev 3930)
@@ -42,6 +42,8 @@
         thisbox.popdown  ++= static.popdownWrite;
         thisbox.visible  ++= static.visibleWrite;
         thisbox.width    ++= static.widthWrite;
+        thisbox.surfaceWidth ++= static.surfaceWidthRead;
+        thisbox.surfaceHeight ++= static.surfaceHeightRead;
         $content.contentwidth ++= static.listwidthWrite;
         $content.contentheight ++= static.contentheightWrite;
         
@@ -58,15 +60,23 @@
         
         $focus.minheight = 6 + vexi.ui.font.height(font, fontsize, "dy");
         
-        thisbox.surfaceWidth = function(dx, sw) {
-            if (v_popbox.width == 0) {
-                v_popbox.forcereflow();
-            }
+    </lib:widget.option>
+    <finalize />
+    
+    static.surfaceWidthRead = function() {
+        var marginleft = trapee.marginleft;
+        var v_popbox = trapee.v_popbox;
+        return function(dx, sw) {
             v_popbox.surface_x =
                 vexi.math.min(dx+marginleft+1, vexi.math.max(0, 
sw-v_popbox.width));
-        }
-        
-        thisbox.surfaceHeight = function(dy, sh) {
+        };
+    }
+    
+    static.surfaceHeightRead = function() {
+        var v_popbox = trapee.v_popbox;
+        var height = trapee.height;
+        var marginbottom = trapee.marginbottom;
+        return function(dy, sh) {
             var h = v_popbox.height;
             if (sh>dy+height-marginbottom-2 + h) {
                 // fit below widget
@@ -78,10 +88,8 @@
                 // make the most of a bad situation
                 v_popbox.surface_y = vexi.math.max(0, sh-h);
             }
-        }
-        
-    </lib:widget.option>
-    <finalize />
+        };
+    }
     
     static.optioninit = { align:"left", orient:"vertical" };
     


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to