Add title pages, standard manuscript format and collapsible panels
Five changes to the export and the window chrome: * Manuscript details gains a contact field and a "Begin exports with a title page" option: the title, the author beneath it, and the contact details beneath that, laid out line for line as typed. A chapters + master export puts the title page on the master, not on each chapter. * "Standard manuscript format" lays an export out the way an agent or an editor expects a submission: 12pt Courier, double-spaced, half-inch first-line indents, a Surname / Title / page header on every page but the title page, chapters opening a third of the way down, and `---` rendered as the conventional centred `#` scene break. The title page becomes the submission kind, with contact top-left and an approximate word count top-right. Off by default; margins were already the standard 1in on US Letter and are unchanged either way. * A folder button beside Export ODT opens the project folder in the file manager -- the enclosing git work tree, including one still awaiting confirmation, since showing a folder is a smaller question than choosing which repository to commit to. * The toolbar and the file list each collapse, from the pair of buttons at the right of the menu bar or from the View menu, and Ctrl+D folds both away together for distraction-free writing. Both choices persist. * The editor sizes to its viewport instead of a fixed 30 rows, so the height a folded panel gives back reaches the page rather than leaving grey space below the text box that did not even take focus. Two traps worth recording. ODF's style:master-page-name is inherited, and any paragraph style carrying one forces a page break before every paragraph that uses it -- a four-line contact block came out as four pages until Contact_20_Line stopped inheriting from Contact_20_Block; a test now pins which styles may carry one. And the status bar shares a function with the toolbar, so guarding that function's top rather than the top panel alone silently took the word counts away with it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GYSGPDwkSzhm4qLqjCbqxU
This commit is contained in:
+10
-1
@@ -82,11 +82,20 @@ impl App {
|
||||
self.apply_field_completion(ui.ctx(), &field);
|
||||
}
|
||||
|
||||
// Fill the viewport rather than a fixed number of rows, so the
|
||||
// height handed back by a folded toolbar or file list reaches
|
||||
// the page instead of leaving grey space under the editor.
|
||||
// Measured against the *unzoomed* row height because that is
|
||||
// what `desired_rows` is multiplied by, whatever the layouter
|
||||
// then draws at.
|
||||
let row_h = ui.text_style_height(&egui::TextStyle::Monospace).max(1.0);
|
||||
let rows = (ui.available_height() / row_h).floor().max(10.0) as usize;
|
||||
|
||||
let output = egui::TextEdit::multiline(&mut self.buffer)
|
||||
.id(egui::Id::new(EDITOR_ID))
|
||||
.code_editor()
|
||||
.desired_width(f32::INFINITY)
|
||||
.desired_rows(30)
|
||||
.desired_rows(rows)
|
||||
.layouter(&mut layouter)
|
||||
.show(ui);
|
||||
if output.response.changed() {
|
||||
|
||||
Reference in New Issue
Block a user