]> gitweb.factorcode.org Git - factor.git/blobdiff - library/ui/ui.factor
Documentation updates, menus fix
[factor.git] / library / ui / ui.factor
index 77bcb3ea241fb5b03c21ff46e84ca2ed35afcccc..7867beffffbc3817464c7f16481de724a4a96f24 100644 (file)
@@ -120,7 +120,7 @@ C: titled-gadget ( gadget title -- )
     windows get [ empty? not ] [ f ] if* ;
 
 : <toolbar> ( target classes -- toolbar )
-    [ commands "Toolbar" swap hash ] map concat
+    [ commands "toolbar" swap hash ] map concat
     [ <command-presentation> ] map-with
     make-shelf ;
 
@@ -128,19 +128,14 @@ C: titled-gadget ( gadget title -- )
     dup command-name swap command-gesture gesture>string
     2array ;
 
-: command-table. ( commands group -- )
-    $heading
+: commands. ( commands -- )
     [ command-gesture key-down? ] subset
     [ command-description ] map
-    { "Command" "Shortcut" } add* $table ;
-
-: commands. ( hash -- )
-    hash>alist
-    [ [ first ] 2apply <=> ] sort
-    [ first2 swap command-table. ] each ;
+    { { $strong "Command" } { $strong "Shortcut" } } add*
+    $table ;
 
 : $commands ( elt -- )
-    dup array? [ first ] when commands commands. ;
+    first2 swap commands hash commands. ;
 
 TUPLE: labelled-gadget content ;