Fix Story Bible Editor's content panel rendering a sliver wide
ui.set_width() was called on the shared horizontal-layout Ui before the tree and editor panels were split off, so it shrank the whole row — tree, separator, and editor panel together — down to a third of the window's width instead of just the tree column. The editor's own heading (the open item's path) was narrow enough to wrap one letter per line as a result. Moving the width constraint onto the tree panel's own child Ui, where it belongs, leaves the editor panel free to take the rest of the row. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -231,11 +231,16 @@ impl App {
|
||||
// that borrow `self` have finished.
|
||||
let mut focused = false;
|
||||
ui.horizontal(|ui| {
|
||||
// Left panel: Tree view (1/3 width)
|
||||
// Left panel: Tree view (1/3 width). The width must be set on
|
||||
// this panel's own child `Ui`, not the shared horizontal one —
|
||||
// that had been shrinking the whole row (tree, separator, and
|
||||
// the editor panel with it) down to a third of the window,
|
||||
// which is why the editor's heading used to wrap one letter at
|
||||
// a time.
|
||||
let tree_width = ui.available_width() / 3.0;
|
||||
ui.set_width(tree_width);
|
||||
|
||||
|
||||
ui.vertical(|ui| {
|
||||
ui.set_width(tree_width);
|
||||
ui.heading("Story Bible");
|
||||
ui.separator();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user