Merge branch 'worktree-agent-a89309a856c8f4947' into integration
This commit is contained in:
@@ -583,8 +583,24 @@ pub(crate) fn sync_rows(
|
||||
// curve must be drawn whatever shape it is in.
|
||||
rows.set_vec(current);
|
||||
curve_moved = true;
|
||||
|
||||
// The curves the widget can switch between, named. They can only
|
||||
// change with the operation set, which is what this branch means, so
|
||||
// the walk that derives them is not on the parameter-event path.
|
||||
let channels: Vec<slint::SharedString> = match session.borrow().as_ref() {
|
||||
Some(s) => s.curve_channels().into_iter().map(Into::into).collect(),
|
||||
None => Vec::new(),
|
||||
};
|
||||
window.set_curve_channels(slint::ModelRc::new(slint::VecModel::from(channels)));
|
||||
}
|
||||
|
||||
// Which curve is plotted, on every pass. Picking one that happens to be
|
||||
// shaped like the last — two untouched curves are both the diagonal —
|
||||
// moves no point, so this cannot ride on the resample below: the chips
|
||||
// would go on highlighting the curve the user just navigated away from.
|
||||
let channel = session.borrow().as_ref().map_or(0, |s| s.curve_channel());
|
||||
window.set_curve_channel(channel);
|
||||
|
||||
if !curve_moved {
|
||||
return;
|
||||
}
|
||||
@@ -1804,6 +1820,24 @@ pub fn run(paths: Vec<PathBuf>) -> Result<()> {
|
||||
redraw(&w);
|
||||
});
|
||||
}
|
||||
{
|
||||
// Which of the curve's curves the plot is showing. **No redraw**, and
|
||||
// that is the whole character of this control: it changes no
|
||||
// parameter, so the photograph is already correct on screen and
|
||||
// recomputing it would be a frame spent to produce the same pixels.
|
||||
// For the same reason it records no history step — there is nothing
|
||||
// to undo — and the sidecar never hears about it.
|
||||
let weak = window.as_weak();
|
||||
let session = session.clone();
|
||||
let rows = rows.clone();
|
||||
window.on_curve_channel_picked(move |index| {
|
||||
let Some(w) = weak.upgrade() else { return };
|
||||
if let Some(s) = session.borrow_mut().as_mut() {
|
||||
s.set_curve_channel(index);
|
||||
}
|
||||
sync_rows(&w, &rows, &session);
|
||||
});
|
||||
}
|
||||
|
||||
// ---- undo and redo (FR-DEV-5) ---------------------------------------
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user