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. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
93de2a6bd6
commit
9a8dbcb92e
15 files changed
+172
-85
No files matched your search
@@ -138,7 +138,13 @@ impl ExportPanel {
|
||||
|
||||
impl RenderOnce for ExportPanel {
|
||||
fn render(self, _: &mut Window, cx: &mut App) -> impl IntoElement {
|
||||
let (id, settings, on_change) = (self.id, self.settings, &self.on_change);
|
||||
let on_change = self
|
||||
.on_change
|
||||
.unwrap_or_else(|| panic!("export panel {:?} has no on_change", self.id));
|
||||
let on_export = self
|
||||
.on_export
|
||||
.unwrap_or_else(|| panic!("export panel {:?} has no on_export", self.id));
|
||||
let (id, settings, on_change) = (self.id, self.settings, &on_change);
|
||||
let files = export_files(&self.name, &settings);
|
||||
let next = added(&settings);
|
||||
let add = editing("export panel", &settings, on_change, move |all, _: ()| {
|
||||
@@ -204,7 +210,7 @@ impl RenderOnce for ExportPanel {
|
||||
)
|
||||
});
|
||||
let theme = cx.theme();
|
||||
let (exported, on_export) = (files.clone(), self.on_export);
|
||||
let (exported, on_export) = (files.clone(), on_export);
|
||||
div()
|
||||
.flex()
|
||||
.flex_col()
|
||||
@@ -233,9 +239,7 @@ impl RenderOnce for ExportPanel {
|
||||
.disabled(exported.is_empty())
|
||||
.on_click(move |_, window, cx| {
|
||||
log::info!("export panel: {exported:?}");
|
||||
if let Some(on_export) = &on_export {
|
||||
on_export(exported.clone(), window, cx);
|
||||
}
|
||||
on_export(exported.clone(), window, cx);
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user