From 2b7bf494017aae2313a03bc2a48621b5fdcfcfb7 Mon Sep 17 00:00:00 2001 From: multiplex55 <6619098+multiplex55@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:26:16 -0500 Subject: [PATCH] Add swap source highlight in dashboard editor --- src/gui/dashboard_editor_dialog.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/dashboard_editor_dialog.rs b/src/gui/dashboard_editor_dialog.rs index 9e5b1283..0ecaf98b 100644 --- a/src/gui/dashboard_editor_dialog.rs +++ b/src/gui/dashboard_editor_dialog.rs @@ -266,13 +266,20 @@ impl DashboardEditorDialog { swapped = true; } } - let swap_label = if self.swap_anchor == Some(idx) { - "Swap (source)" + let is_swap_source = self.swap_anchor == Some(idx); + let swap_label = if is_swap_source { + "Swap source" } else { "Swap" }; - if ui.button(swap_label).clicked() { - if self.swap_anchor == Some(idx) { + let swap_button = if is_swap_source { + egui::Button::new(swap_label) + .fill(egui::Color32::from_rgb(60, 120, 200)) + } else { + egui::Button::new(swap_label) + }; + if ui.add(swap_button).clicked() { + if is_swap_source { self.swap_anchor = None; } else if let Some(anchor) = self.swap_anchor { if let Err(err) =