feat: open the command palette when clicking the modestate widget
Instead of switching input modes, which can now be done via the command palette instead.
This commit is contained in:
		
							parent
							
								
									27c5e940f5
								
							
						
					
					
						commit
						0dd9cb179e
					
				
					 1 changed files with 7 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -58,10 +58,11 @@ fn render_separator(self: *Button.State(void), theme: *const Widget.Theme) void
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
fn on_click(_: *void, _: *Button.State(void)) void {
 | 
			
		||||
    command.executeName(if (is_mini_mode())
 | 
			
		||||
        "exit_mini_mode"
 | 
			
		||||
    else if (is_overlay_mode())
 | 
			
		||||
        "exit_overlay_mode"
 | 
			
		||||
    else
 | 
			
		||||
        "toggle_input_mode", .{}) catch {};
 | 
			
		||||
    if (is_mini_mode()) {
 | 
			
		||||
        command.executeName("exit_mini_mode", .{}) catch {};
 | 
			
		||||
    } else if (is_overlay_mode()) {
 | 
			
		||||
        command.executeName("exit_overlay_mode", .{}) catch {};
 | 
			
		||||
    } else {
 | 
			
		||||
        command.executeName("enter_overlay_mode", command.fmt(.{"command_palette"})) catch {};
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue