mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-13 22:02:31 +00:00
Dialogs: the Color Picker opens at its full height (#2129)
A centred dialog window offers its body only last frame's height, and the Color Picker lays itself out on a fixed 566 x 334 canvas, so it opened clipped to its top strip behind a scrollbar: the colour field cut off, no value fields, no hex code, OK and Cancel visible but blind, and the window not resizable. The body's minimum scrolled height now covers the picker's canvas, as it already did for Numbering & Section Options.
Verified locally on a288a87b: fmt, clippy, the picker's own tests; opened on macOS at full height.
This commit is contained in:
1 parent
a288a87bf6
commit
5f86f33c42
1 file changed
+10
-3
@@ -3016,9 +3016,16 @@ pub fn show(app: &mut DesignApp, ctx: &egui::Context) {
|
||||
result = Some(false);
|
||||
}
|
||||
}
|
||||
// A centred window only offers its body last frame's height: let this one grow to its
|
||||
// options' height (the screen still caps it).
|
||||
let min_body = if side_actions { body_height.min(crate::section_options::BODY_H) } else { 1.0 };
|
||||
// A centred window only offers its body last frame's height: let these grow to their
|
||||
// content's height (the screen still caps it). Numbering & Section Options has its
|
||||
// options beside its buttons; the Color Picker lays itself out on a fixed canvas, which
|
||||
// otherwise shows only its top strip (the field cut off, no values, no hex) behind a
|
||||
// scrollbar.
|
||||
let min_body = match d.id.as_str() {
|
||||
"numberingSection" => body_height.min(crate::section_options::BODY_H),
|
||||
"colorPicker" => body_height.min(picker_layout::SIZE.y + 2.0 * ui.spacing().item_spacing.y),
|
||||
_ => 1.0,
|
||||
};
|
||||
egui::ScrollArea::both()
|
||||
.id_salt(("dialog_body", &d.id))
|
||||
.min_scrolled_width(1.0)
|
||||
|
||||
Reference in new issue
Block a user