mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-14 22:35:26 +00:00
Text Frame Options: the dialog is one row taller for a non-rectangular frame
The Inset row made the General tab taller than the dialog's fixed height, so the buttons moved when switching tabs. The fixed height now includes that row.
This commit is contained in:
1 parent
293fe55a4d
commit
0db4ba3dd4
2 files changed
+13
-3
No files matched your search
@@ -1106,9 +1106,11 @@ fn text_frame_options_dialog(app: &DesignApp, ui: &mut egui::Ui, d: &mut Dialog)
|
||||
}
|
||||
ui.set_min_width(560.0);
|
||||
ui.horizontal_top(|ui| {
|
||||
// A fixed height: the separator would otherwise stretch the dialog to the window.
|
||||
ui.set_min_height(330.0);
|
||||
ui.set_max_height(330.0);
|
||||
// A fixed height: the separator would otherwise stretch the dialog to the window. A
|
||||
// non-rectangular frame's Inset row needs one more row.
|
||||
let height = if d.b("_shaped") { 360.0 } else { 330.0 };
|
||||
ui.set_min_height(height);
|
||||
ui.set_max_height(height);
|
||||
section_list(
|
||||
&lang,
|
||||
ui,
|
||||
|
||||
@@ -1549,6 +1549,14 @@ fn text_frame_options_dims_the_sides_for_a_non_rectangular_frame() {
|
||||
}
|
||||
assert_eq!(h.query_by_label("Inset:").is_some(), shaped, "{shape}: the Inset caption");
|
||||
assert_eq!(h.query_by_label("Increase tfo_inset").is_some(), shaped, "{shape}: the Inset field");
|
||||
// The General tab fits in the dialog's fixed height: the buttons stay put on another tab.
|
||||
let (wrap, cancel) = (h.get_by_label("Ignore Text Wrap").rect().bottom(), h.get_by_label("Cancel").rect().top());
|
||||
assert!(wrap < cancel, "{shape}: Ignore Text Wrap ends at {wrap}, below the top of Cancel at {cancel}");
|
||||
h.get_by_label("Auto-Size").click();
|
||||
h.run_steps(3);
|
||||
assert_eq!(h.get_by_label("Cancel").rect().top(), cancel, "{shape}: the buttons stay put on another tab");
|
||||
h.get_by_label("General").click();
|
||||
h.run_steps(3);
|
||||
// The link toggles only for a rectangle.
|
||||
let linked = |h: &Harness<'_, DesignApp>| h.state().ui.dialog.as_ref().unwrap().b("insetLinked");
|
||||
let before = linked(&h);
|
||||
|
||||
Reference in new issue
Block a user