@@ -12,13 +12,10 @@ struct MenubarScope {
1212 model : MenubarModel
1313 counter : Ref [Int ]
1414 focus_claimed : Ref [Bool ]
15- activate : @cmd.Emit [(String , Int )]
1615 toggle : @cmd.Emit [(String , Int )]
1716 close_command : @cmd.Cmd
18- set_active : @cmd.Emit [Int ]
1917 toggle_checked : @cmd.Emit [String ]
2018 set_radio : @cmd.Emit [(String , String )]
21- set_submenu : @cmd.Emit [MenuSubmenuChange ]
2219}
2320
2421///|
@@ -570,26 +567,20 @@ fn menubar_trigger_id(id : String, index : Int) -> String {
570567fn menubar_scope(
571568 id : String ,
572569 model : MenubarModel ,
573- activate : @cmd.Emit [(String , Int )],
574570 toggle : @cmd.Emit [(String , Int )],
575571 close_command : @cmd.Cmd ,
576- set_active : @cmd.Emit [Int ],
577572 toggle_checked : @cmd.Emit [String ],
578573 set_radio : @cmd.Emit [(String , String )],
579- set_submenu : @cmd.Emit [MenuSubmenuChange ],
580574) -> MenubarScope {
581575 {
582576 id,
583577 model,
584578 counter: Ref (0),
585579 focus_claimed: Ref (false ),
586- activate,
587580 toggle,
588581 close_command,
589- set_active,
590582 toggle_checked,
591583 set_radio,
592- set_submenu,
593584 }
594585}
595586
@@ -686,7 +677,6 @@ pub fn menubar(
686677 (current, @cmd.none)
687678 } else {
688679 let next = {
689- ..current,
690680 active_value: Some (value),
691681 active_index: index,
692682 focus_index: index,
@@ -706,7 +696,6 @@ pub fn menubar(
706696 }
707697 MenubarSwitch (value, index) => {
708698 let next = {
709- ..current,
710699 active_value: Some (value),
711700 active_index: index,
712701 focus_index: index,
@@ -736,7 +725,6 @@ pub fn menubar(
736725 } else if current.active_value == Some (value) {
737726 (
738727 {
739- ..current,
740728 active_value: None ,
741729 active_index: -1,
742730 focus_index: index,
@@ -754,7 +742,6 @@ pub fn menubar(
754742 )
755743 } else {
756744 let next = {
757- ..current,
758745 active_value: Some (value),
759746 active_index: index,
760747 focus_index: index,
@@ -780,7 +767,6 @@ pub fn menubar(
780767 if current.active_value is Some (_) {
781768 (
782769 {
783- ..current,
784770 active_value: None ,
785771 active_index: -1,
786772 focus_index: current.active_index,
@@ -811,7 +797,6 @@ pub fn menubar(
811797 } else {
812798 (
813799 {
814- ..current,
815800 active_value: Some (value),
816801 active_index: index,
817802 focus_index: index,
@@ -823,7 +808,6 @@ pub fn menubar(
823808 } else if current.active_value == Some (value) {
824809 (
825810 {
826- ..current,
827811 active_value: None ,
828812 active_index: -1,
829813 focus_index: index,
@@ -895,13 +879,10 @@ pub fn menubar(
895879 let scope = menubar_scope(
896880 id,
897881 model,
898- emit.map(pair => MenubarActivate (pair.0, pair.1)),
899882 emit.map(pair => MenubarToggle (pair.0, pair.1)),
900883 emit(MenubarClose ),
901- emit.map(index => MenubarSetActive (index)),
902884 emit.map(value => MenubarToggleChecked (value)),
903885 emit.map(pair => MenubarSetRadio (pair.0, pair.1)),
904- emit.map(value => MenubarSetSubmenu (value)),
905886 )
906887 let element_attrs = menu_state_attrs(
907888 attrs,
@@ -962,12 +943,9 @@ pub fn menubar(
962943 id,
963944 model,
964945 menu_noop_emit(),
965- menu_noop_emit(),
966946 @cmd.none,
967947 menu_noop_emit(),
968948 menu_noop_emit(),
969- menu_noop_emit(),
970- menu_noop_emit(),
971949 )
972950 let element_attrs = menu_state_attrs(
973951 attrs,
@@ -1048,13 +1026,10 @@ pub fn[C : @html.IsChildren] menubar_menu(
10481026 trigger_id: menubar_trigger_id(scope.id, index),
10491027 model: menu_model,
10501028 counter: Ref (0),
1051- open_command: (scope.activate)((value, index)),
10521029 close_command: scope.close_command,
10531030 toggle_command: (scope.toggle)((value, index)),
1054- set_active: scope.set_active,
10551031 toggle_checked: scope.toggle_checked,
10561032 set_radio: scope.set_radio,
1057- set_submenu: scope.set_submenu,
10581033 }
10591034 @html.div(
10601035 style=ui_styles([UiBoxSizing , "display:contents"], style),
0 commit comments