fix(gui): scroll the Settings body and add a Defaults reset to the editor
The Settings screen grew past a short window once the Appearance section landed, forcing a manual resize to reach the Save button. Wrap the body in a vertical ScrollArea (header stays pinned), mirroring the Host screen. Also add a '↺ Defaults' button to the right of Save in the theme editor that resets the draft to the original Default Dark palette (previews live). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1010,6 +1010,13 @@ impl PixelPassApp {
|
||||
ui.heading("Settings");
|
||||
});
|
||||
ui.separator();
|
||||
// Body scrolls; the header above stays pinned. The Appearance editor
|
||||
// (13 colour rows + Save) overflows a short window otherwise — you'd
|
||||
// have to resize the window to reach the Save button.
|
||||
egui::ScrollArea::vertical().show(ui, |ui| self.settings_body(ui));
|
||||
}
|
||||
|
||||
fn settings_body(&mut self, ui: &mut egui::Ui) {
|
||||
ui.add_space(4.0);
|
||||
|
||||
let resp = ui.checkbox(
|
||||
@@ -1149,6 +1156,13 @@ impl PixelPassApp {
|
||||
if ui.button("💾 Save").clicked() {
|
||||
self.save_draft_theme();
|
||||
}
|
||||
// Reset the draft to the original Default Dark palette. Previews
|
||||
// live (the editor applies the draft each frame), so it snaps back
|
||||
// immediately; Save persists it, Cancel discards.
|
||||
if ui.button("↺ Defaults").clicked() {
|
||||
self.theme.draft = theme::default_dark();
|
||||
self.theme.status = Some("Reset to the Default Dark palette.".to_string());
|
||||
}
|
||||
if ui.button("Cancel").clicked() {
|
||||
self.cancel_theme_edit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user