diff --git a/crates/debugger_ui/src/debugger_panel_item.rs b/crates/debugger_ui/src/debugger_panel_item.rs index e512e868c0..0a6c11c039 100644 --- a/crates/debugger_ui/src/debugger_panel_item.rs +++ b/crates/debugger_ui/src/debugger_panel_item.rs @@ -436,20 +436,7 @@ impl Render for DebugPanelItem { .child( h_flex() .gap_2() - .when( - self.current_thread_state().status != ThreadStatus::Running, - |this| { - this.child( - IconButton::new("debug-continue", IconName::DebugContinue) - .on_click(cx.listener(|_, _, cx| { - cx.dispatch_action(Box::new(Continue)) - })) - .disabled(thread_status != ThreadStatus::Stopped) - .tooltip(move |cx| Tooltip::text("Continue program", cx)), - ) - }, - ) - .when( + .when_else( self.current_thread_state().status == ThreadStatus::Running, |this| { this.child( @@ -460,6 +447,16 @@ impl Render for DebugPanelItem { .tooltip(move |cx| Tooltip::text("Pause program", cx)), ) }, + |this| { + this.child( + IconButton::new("debug-continue", IconName::DebugContinue) + .on_click(cx.listener(|_, _, cx| { + cx.dispatch_action(Box::new(Continue)) + })) + .disabled(thread_status != ThreadStatus::Stopped) + .tooltip(move |cx| Tooltip::text("Continue program", cx)), + ) + }, ) .child( IconButton::new("debug-step-over", IconName::DebugStepOver)