]> gitweb.factorcode.org Git - factor.git/commitdiff
allow window pref-dim to be provided in world-attributes
authorJoe Groff <arcata@gmail.com>
Fri, 15 Jan 2010 23:33:37 +0000 (15:33 -0800)
committerJoe Groff <arcata@gmail.com>
Fri, 15 Jan 2010 23:33:37 +0000 (15:33 -0800)
basis/ui/gadgets/tracks/tracks.factor
basis/ui/gadgets/worlds/worlds.factor

index 387f41a6a4e461144315a25f0c5ffd82a3af53cb..89389485b24832e4c0b8e5be83fe2d2097a09651 100644 (file)
@@ -39,7 +39,8 @@ TUPLE: track < pack sizes ;
 M: track layout* ( track -- ) dup track-layout pack-layout ;
 
 : track-pref-dims-1 ( track -- dim )
-    children>> pref-dims max-dim ;
+    [ children>> pref-dims max-dim ]
+    [ pref-dim>> { 0 0 } or ] bi vmax ;
 
 : track-pref-dims-2 ( track -- dim )
     [
index 8f38cee988c308db60eb461bf28a8d6f957b3fe0..83783102538bba16ad7c7750df8dd26fe577fde2 100644 (file)
@@ -50,7 +50,8 @@ TUPLE: world-attributes
     status
     gadgets
     { pixel-format-attributes initial: $ default-world-pixel-format-attributes }
-    { window-controls initial: $ default-world-window-controls } ;
+    { window-controls initial: $ default-world-window-controls }
+    pref-dim ;
 
 : <world-attributes> ( -- world-attributes )
     world-attributes new ; inline
@@ -133,6 +134,7 @@ M: world request-focus-on ( child gadget -- )
         [ initial-background-color >>background-color ]
         [ grab-input?>> >>grab-input? ]
         [ gadgets>> [ 1 track-add ] each ]
+        [ pref-dim>> >>pref-dim ]
     } cleave ;
 
 : <world> ( world-attributes -- world )