Skip to content

Commit bc830ff

Browse files
authored
Merge pull request #658 from multiplex55/codex/add-per-slot-swap-action-to-dashboard-editor
Highlight swap source slots in dashboard editor
2 parents 0e3cf5d + 2b7bf49 commit bc830ff

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/gui/dashboard_editor_dialog.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,20 @@ impl DashboardEditorDialog {
266266
swapped = true;
267267
}
268268
}
269-
let swap_label = if self.swap_anchor == Some(idx) {
270-
"Swap (source)"
269+
let is_swap_source = self.swap_anchor == Some(idx);
270+
let swap_label = if is_swap_source {
271+
"Swap source"
271272
} else {
272273
"Swap"
273274
};
274-
if ui.button(swap_label).clicked() {
275-
if self.swap_anchor == Some(idx) {
275+
let swap_button = if is_swap_source {
276+
egui::Button::new(swap_label)
277+
.fill(egui::Color32::from_rgb(60, 120, 200))
278+
} else {
279+
egui::Button::new(swap_label)
280+
};
281+
if ui.add(swap_button).clicked() {
282+
if is_swap_source {
276283
self.swap_anchor = None;
277284
} else if let Some(anchor) = self.swap_anchor {
278285
if let Err(err) =

0 commit comments

Comments
 (0)