Clean up show continue/pause buttons

This commit is contained in:
Remco Smits
2024-07-17 15:43:16 +02:00
parent ef67321ff2
commit d08e28f4e0

View File

@@ -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)