From 3dfae1781f86810fe323e27f190b75fa3befea81 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 11 Feb 2009 04:56:01 -0600 Subject: [PATCH] Add min-dim slot to border gadgets --- basis/ui/gadgets/borders/borders.factor | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/basis/ui/gadgets/borders/borders.factor b/basis/ui/gadgets/borders/borders.factor index 15fce8593c..708b50d709 100644 --- a/basis/ui/gadgets/borders/borders.factor +++ b/basis/ui/gadgets/borders/borders.factor @@ -7,7 +7,8 @@ IN: ui.gadgets.borders TUPLE: border < gadget { size initial: { 0 0 } } { fill initial: { 0 0 } } -{ align initial: { 1/2 1/2 } } ; +{ align initial: { 1/2 1/2 } } +{ min-dim initial: { 0 0 } } ; : new-border ( child class -- border ) new-gadget swap add-gadget ; inline @@ -20,7 +21,8 @@ TUPLE: border < gadget { 1 1 } >>fill ; M: border pref-dim* - [ size>> 2 v*n ] [ gadget-child pref-dim ] bi v+ ; + [ [ size>> 2 v*n ] [ gadget-child pref-dim ] bi v+ ] + [ min-dim>> ] bi vmax ; M: border baseline [ size>> second ] [ gadget-child baseline ] bi + ;