]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.tools.button-list: not sure why this commit was missed
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 25 Jan 2022 22:09:08 +0000 (14:09 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 25 Jan 2022 22:09:08 +0000 (14:09 -0800)
basis/ui/gadgets/buttons/buttons.factor
basis/ui/tools/button-list/button-list.factor

index c7609dbe06da538cee7120a2953cacf17679b1f5..11889b9a5c6436b04c8f46bea7c2a5e007a2bab8 100644 (file)
@@ -40,11 +40,14 @@ PRIVATE>
 : button-leave ( button -- )
     [ hide-status ] [ button-update ] bi ;
 
+: button-invoke ( button -- )
+    dup quot>> call( button -- ) ;
+
 : button-clicked ( button -- )
     [ ]
     [ button-update ]
     [ button-rollover? ] tri
-    [ dup quot>> call( button -- ) ] [ drop ] if ;
+    [ button-invoke ] [ drop ] if ;
 
 button H{
     { T{ button-up } [ button-clicked ] }
index 87678d758e23c86e90f32dfd1adc1d2062d19bed..fb99e0c4a61cc9ef6d6512b4a11327ebb228f28c 100644 (file)
@@ -39,7 +39,10 @@ M: clickable ungraft*
 : <active-buttons-table> ( model -- table )
     [ keys [ ">" swap 2array ] map ] <arrow> trivial-renderer [ second ] <search-table> 
     dup table>>
-        [ second world-buttons at invoke-primary ] >>action
+        [
+            second world-buttons at dup presentation?
+            [ invoke-primary ] [ button-invoke ] if
+        ] >>action
         [ hide-glass ] >>hook
         t >>selection-required?
         10 >>min-rows