Stabilize input picker rows with background hover feedback

This commit is contained in:
Dandaedre 2026-11-18 17:50:28 +01:00
parent eb1f7e856b
commit 28f5709b94
6 changed files with 12 additions and 4 deletions

2
Cargo.lock generated
View File

@ -602,7 +602,7 @@ dependencies = [
[[package]]
name = "canvas-pilot"
version = "0.10.0-rc.2"
version = "0.10.0-rc.3"
dependencies = [
"base64 0.22.1",
"craft-dwg",

View File

@ -4,7 +4,7 @@ default-members = ["crates/canvas-pilot"]
resolver = "3"
[workspace.package]
version = "0.10.0-rc.2"
version = "0.10.0-rc.3"
edition = "2024"
license = "MIT"
repository = "https://proxy.dandaedre.com/gitea/idle-org/canvas-pilot"

View File

@ -26,6 +26,7 @@ fn input_picker(
.close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside)
.selected_text(input_label(inputs, *selected))
.show_ui(ui, |ui| {
ui.visuals_mut().widgets.hovered.bg_stroke.color = egui::Color32::TRANSPARENT;
ui.checkbox(show_empty, "Show inputs without signal")
.on_hover_text(tr(
ui.ctx(),

View File

@ -713,7 +713,8 @@ impl Editor {
ui.horizontal(|ui| {
ui.label(tr(ui.ctx(), "ui.device-input"));
egui::ComboBox::from_id_salt(("source-input",i)).selected_text(if choice.input==0 {"Choose input…".into()} else {format!("Input {}",choice.input)}).show_ui(ui,|ui| {
for input in &available {ui.selectable_value(&mut choice.input,input.id,format!("Input {}{}",input.id,if input.signal {""} else {" · No signal"}));}
ui.visuals_mut().widgets.hovered.bg_stroke.color = egui::Color32::TRANSPARENT;
for input in &available {ui.stable_selectable_value(&mut choice.input,input.id,format!("Input {}{}",input.id,if input.signal {""} else {" · No signal"}));}
});
ui.checkbox(&mut choice.change,tr(ui.ctx(), "ui.change-input")).on_hover_text("Switch this layer's mapped device destinations to the selected input on the next Send. Nothing changes immediately.");
});

View File

@ -134,7 +134,8 @@ impl Editor {
ui.add_enabled_ui(self.inputs.pending.is_none(),|ui|{
egui::ComboBox::from_id_salt("device-input-picker").selected_text(format!("Input {}",self.inputs.selected)).show_ui(ui,|ui|{
for input in &inputs {
if ui.selectable_value(&mut self.inputs.selected,input.id,format!("Input {}{}{}",input.id,if input.signal{""}else{" · no signal"},if self.inputs.drafts.get(&input.id).is_some_and(InputDraft::dirty){" · edited"}else{""})).changed(){
ui.visuals_mut().widgets.hovered.bg_stroke.color = egui::Color32::TRANSPARENT;
if ui.stable_selectable_value(&mut self.inputs.selected,input.id,format!("Input {}{}{}",input.id,if input.signal{""}else{" · no signal"},if self.inputs.drafts.get(&input.id).is_some_and(InputDraft::dirty){" · edited"}else{""})).changed(){
self.inputs.capture=None;self.inputs.capture_key=None;self.inputs.drag=None;self.inputs.edit_start=None;
}
}

View File

@ -4,6 +4,11 @@
## Unreleased
### v0.10.0-rc.3
- Use stable selectable rows and a subtle background hover in device input
pickers, avoiding border-driven shifts when moving between inputs.
### v0.10.0-rc.2
- Tighten input reference picture rows from 44 to 32 pixels apart while retaining