We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0e3cf5d + 2b7bf49 commit bc830ffCopy full SHA for bc830ff
1 file changed
src/gui/dashboard_editor_dialog.rs
@@ -266,13 +266,20 @@ impl DashboardEditorDialog {
266
swapped = true;
267
}
268
269
- let swap_label = if self.swap_anchor == Some(idx) {
270
- "Swap (source)"
+ let is_swap_source = self.swap_anchor == Some(idx);
+ let swap_label = if is_swap_source {
271
+ "Swap source"
272
} else {
273
"Swap"
274
};
- if ui.button(swap_label).clicked() {
275
- if self.swap_anchor == Some(idx) {
+ 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
280
+ };
281
+ if ui.add(swap_button).clicked() {
282
+ if is_swap_source {
283
self.swap_anchor = None;
284
} else if let Some(anchor) = self.swap_anchor {
285
if let Err(err) =
0 commit comments