1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
// Only `search` is `pub`: `refresh_diagram_list` is reused by a downstream binary's
// sync-complete handler (see `search::refresh_diagram_list`'s doc comment). The rest
// are wiring `build_main_window` uses internally.
// The command palette (Ctrl+K): one table of every action with a fuzzy search and
// availability rules -- see the module's own doc comment.
// Converting a startup custom-materials row read into the render context's
// material/specific-gravity lists -- see the module's own doc comment.
// The `indicatrix-cut-core`-backed Edit sub-tab.
// The Edit sub-tab's resizable-dock/collapsible-section layout persistence -- lives
// in its own module purely to keep this file from growing further; see this
// module's own doc comment.
// "Is an export running?" for the start guards, the header export indicator's wording and the
// close guard's sentence for a dialog export -- see the module's own doc comment.
// Opening the bundled user manual and revealing the Edit tab's last-saved folder --
// see the module's own doc comment.
// The in-app help: the manual compiled into the program and shown in its own window, the
// glossary dialog, and the topic ids a panel's "?" button opens -- see the module's own doc
// comment.
pub
// Building/wiring the `MainWindow` and its `MainWindowHandle` RAII guard -- see the
// module's own doc comment. Moved out of this file purely to keep it from growing
// further.
// App-wide preferences (Simple/Advanced, UI scale, high contrast, larger handles, the
// remembered Snap/Slice pills) -- see the module's own doc comment. `pub` only for
// `saved_ui_scale_factor`, which `main` calls before the first window exists.
// Resolving a native picker's starting directory from a text field's current value --
// see the module's own doc comment.
// The single shared 5x7 bitmap-font glyph lookup for `solid_preview::diagram2d`'s
// panel labels and `tilt::video_export::overlay`'s readout text -- see the
// module's own doc comment. Moved into `indicatrix-solid` (`solid_preview::
// diagram2d`'s own crate) and re-exported here at its old path so this app's own
// `tilt::video_export::overlay` keeps resolving `gui::pixel_font` unchanged.
pub use pixel_font;
// The one place the `rfd` crate's file dialog is ever constructed in this app
// -- an off-UI-thread native picker/save-as/pick-folder worker plus the
// UI-thread rendezvous and test hook every other module's own picker needs
// use through this. See the module's own doc comment.
pub
// Render jobs: the frozen job <-> scene conversion, the one executor that renders a job
// (the app's queue and `indicatrix-cli render`/`tilt-video` both call it) and the public
// headless entry point -- see the module's own doc comment.
// The Library menu's "Plan Rough..." dialog: up to K stones of library designs out of
// one rough block -- see the module's own doc comment.
// The real `PreviewSink` that hops a finished solid-preview frame back onto the UI
// thread -- see the module's own doc comment. Moved out of this file purely to keep
// it from growing further.
// Startup settings-application and the settings-value <-> UI-pill-index conversions
// that go with it -- moved out of this file purely to keep it from growing further.
// Several of its items are used well beyond startup (e.g. by callbacks that need the
// same index<->value mapping later), so this module re-exports them flatly below
// rather than requiring every caller to spell out `gui::startup_settings::`.
// A design file named on the command line (an OS double-click association starts the
// program with it as the argument) -- see the module's own doc comment.
// Reports what happens on screen (a facet picked, a file exported, ...) to the open tutorial --
// see the module's own doc comment.
pub
// Fits the main window to its monitor on first show -- see the module doc for why the
// .slint preferred size alone is not enough on Full HD displays.
// The window-close unsaved-changes guard's Save/Discard callbacks -- see the
// module's own doc comment.
// A rolling, regression-based time-remaining estimator shared by the still-image
// export queue (`render::render_export::queue`) and the tilt-video export
// (`tilt::video_export::run`) -- see the module's own doc comment for why a
// regression over a window rather than an instantaneous rate.
// `sync_range_bounds_to_ui` is defined in `library::diagram_list` but re-exported here
// so its public path (`gui::sync_range_bounds_to_ui`) is unchanged for a downstream
// binary's sync-complete handler and this crate's own `gui::library`, both of which
// call it at that spelling.
pub use sync_range_bounds_to_ui;
// `search` is grouped into `gui::library` with the rest of the library UI (see
// that module's own doc comment), and re-exported here under this name so
// `gui::search` (the path a downstream binary's sync-complete handler is
// documented to use -- see `search::refresh_diagram_list`'s doc comment) keeps
// resolving.
pub use search;
// `MainWindowHandle`/`build_main_window` are re-exported here (rather than only at
// `gui::main_window::`) so their public path (`gui::MainWindowHandle`/
// `gui::build_main_window`) is unchanged for the downstream binary
// `lib.rs`'s own doc comment describes.
pub use ;
// `gui::library::search::fetch` opens a read-only connection to the same on-disk
// design library for background search -- see `DB_PATH`'s own doc comment.
pub use DB_PATH;
// Flat re-exports so every existing call site elsewhere in `gui` (which all spell
// these as `gui::X`, never `gui::startup_settings::X`) keeps resolving unchanged.
pub use ;
// Same reasoning as the `startup_settings` re-export above -- every existing call
// site spells this as `gui::starting_dir_from_picker_field`.
use starting_dir_from_picker_field;
use crateMainWindow;
use ComponentHandle;
/// This crate's binary entry point (`apps/indicatrix-cut/src/main.rs` calls
/// straight through to this).
///
/// # Errors
///
/// See [`run_gui`].
/// Runs this crate's window standalone: builds it (see [`build_main_window`])
/// and runs it to completion.
///
/// # Errors
///
/// Returns an error if [`build_main_window`] or the window's own event loop
/// (`MainWindow::run`) fails -- see [`build_main_window`]'s doc comment for what that
/// covers.
/// Shows a toast message.
///
/// Informational/success toasts auto-dismiss after 3.5s; `"error"` and `"warning"`
/// stay on screen until the user dismisses them (via
/// `Toast.dismiss` -> `root.toast_visible = false` in `app.slint`), since a
/// critical outcome the user needed to act on could otherwise disappear before
/// they read it. `"warning"` is for a critical-but-not-failed outcome
/// (e.g. "your masts are placeholders", "the saved meet constraints were not
/// restored") that deserves the same persistence as an error without implying the
/// action itself failed; `ui/components/toast.slint`'s `Toast` component has
/// its own amber `"warning"` branch on background/border/icon color, so a
/// `"warning"` toast renders distinctly from both `"info"` and `"error"` rather
/// than falling back to the info-style default.
///
/// A plain function (not a closure) since it captures nothing from `run_gui` --
/// every `ui.on_X` callback across this module's submodules that needs it just calls
/// it directly on its own `ui: &MainWindow`. `pub` because a downstream binary
/// reusing this window needs to surface its own results through the same toast.