Settings: controls give way, notices fold, and every edit needs its owner

A settings row's control slot shrinks to the box, so a control's text
wraps and a palette's row folds; the font size's sample wraps in a plain
block. A notice's boxes carry their channel's name and fold under the
kind's name when narrow. canvas::panel::editing takes the owner's
handler itself: the design panels, the structure editor, the index
manager and the privacy, notice and startup settings take theirs at
render and fail loud without one. Apply fails loud if pressed while the
proxy does not read. Tests cover Apply resting on a bad port, the way
back resting at the default size and a box pressed off.
This commit is contained in:
ZacharyZhang-NY committed 2026-09-27 12:53:08 -04:00
1 parent 380cdb0676
commit 195f9964a0
15 files changed
+172 -85

No files matched your search

+4 -1
View File
@@ -45,6 +45,9 @@ impl InspectorPanel {
impl RenderOnce for InspectorPanel {
fn render(self, _: &mut Window, cx: &mut App) -> impl IntoElement {
let on_change = self
.on_change
.unwrap_or_else(|| panic!("inspector panel {:?} has no on_change", self.id));
let id = self.id;
let [shape] = self.selection.as_slice() else {
let title: SharedString = match self.selection.len() {
@@ -55,7 +58,7 @@ impl RenderOnce for InspectorPanel {
.body("Select one layer to see its properties.")
.into_any_element();
};
let on_change = &self.on_change;
let on_change = &on_change;
let at = |edit: fn(&mut Shape, f64)| editing("inspector", shape, on_change, edit);
let scrub = |name: &'static str, value: f32, least: f64| {
ScrubInput::new((id.clone(), name), name, value as f64)