| 88 |
88 |
|
use quasi_router::layout::{self, FieldKind, Priority, Tone, Width};
|
| 89 |
89 |
|
use quasi_router::{
|
| 90 |
90 |
|
Act, Action, Choice, Consult, Field, Node, RegionKind, Request, Response, RouteError, Router,
|
| 91 |
|
- |
Screen, Slot,
|
|
91 |
+ |
Run, Screen, Slot,
|
| 92 |
92 |
|
};
|
| 93 |
93 |
|
|
| 94 |
94 |
|
use super::{Panel, Panels, Where};
|
| 300 |
300 |
|
// already carry what each is worth (`Panel::worth`), which is the declared
|
| 301 |
301 |
|
// replacement for the `screen_w < 900.0` collapse, and a fallback that kept
|
| 302 |
302 |
|
// everything would leave those ranks saying nothing.
|
| 303 |
|
- |
let bar = Slot::new(BAR, RegionKind::Band).across(layout::Fallback::Shed);
|
|
303 |
+ |
//
|
|
304 |
+ |
// The row is built as a row and then given to the region, which is what
|
|
305 |
+ |
// lets the builders below take a `Run` and add to it. They used to take the
|
|
306 |
+ |
// whole `Slot`, and what they were relying on was that this function had
|
|
307 |
+ |
// already called `across` on it: a promise nothing in their signatures made
|
|
308 |
+ |
// and no compiler could check. `Run::new` is the only way to make a row and
|
|
309 |
+ |
// it takes the fallback, so a helper holding one is holding a row that has
|
|
310 |
+ |
// already said what it does when it is tight.
|
|
311 |
+ |
let bar = Run::new(layout::Fallback::Shed);
|
| 304 |
312 |
|
let bar = here(bar, state);
|
| 305 |
313 |
|
let bar = holding(bar, state);
|
| 306 |
314 |
|
let bar = looking(bar, state);
|
| 307 |
|
- |
panels(bar, state)
|
|
315 |
+ |
let bar = panels(bar, state);
|
|
316 |
+ |
Slot::new(BAR, RegionKind::Band).across(bar)
|
| 308 |
317 |
|
}
|
| 309 |
318 |
|
|
| 310 |
319 |
|
/// Where you are, which is one of three things.
|
| 314 |
323 |
|
/// "making every linked value a button would put a row of bevels down the first
|
| 315 |
324 |
|
/// column of half a dashboard". A breadcrumb is the case that argument was
|
| 316 |
325 |
|
/// written for.
|
| 317 |
|
- |
fn here(bar: Slot, state: &Panels<'_>) -> Slot {
|
|
326 |
+ |
fn here(bar: Run, state: &Panels<'_>) -> Run {
|
| 318 |
327 |
|
match state.bar.place() {
|
| 319 |
328 |
|
Where::Folder { trail } => {
|
| 320 |
329 |
|
let mut bar = bar.beside(
|
| 429 |
438 |
|
/// Nothing at all when it is empty. An empty basket is not a query with no
|
| 430 |
439 |
|
/// results, it is no query, and a control for a question nobody has asked is
|
| 431 |
440 |
|
/// noise on a bar that already sheds members to fit.
|
| 432 |
|
- |
fn holding(bar: Slot, state: &Panels<'_>) -> Slot {
|
|
441 |
+ |
fn holding(bar: Run, state: &Panels<'_>) -> Run {
|
| 433 |
442 |
|
let held = state.bar.basket();
|
| 434 |
443 |
|
if held.is_empty() {
|
| 435 |
444 |
|
return bar;
|
| 479 |
488 |
|
}
|
| 480 |
489 |
|
|
| 481 |
490 |
|
/// A mode you are in, and the way out of it.
|
| 482 |
|
- |
fn leaving(bar: Slot, says: String, out: &str) -> Slot {
|
|
491 |
+ |
fn leaving(bar: Run, says: String, out: &str) -> Run {
|
| 483 |
492 |
|
bar.beside(
|
| 484 |
493 |
|
Node::Text {
|
| 485 |
494 |
|
text: says,
|
| 494 |
503 |
|
}
|
| 495 |
504 |
|
|
| 496 |
505 |
|
/// What you are looking for.
|
| 497 |
|
- |
fn looking(bar: Slot, state: &Panels<'_>) -> Slot {
|
|
506 |
+ |
fn looking(bar: Run, state: &Panels<'_>) -> Run {
|
| 498 |
507 |
|
let searching = state.bar.searching();
|
| 499 |
508 |
|
|
| 500 |
509 |
|
let mut bar = bar
|
| 569 |
578 |
|
/// and the last three controls are addresses this router already serves. That is
|
| 570 |
579 |
|
/// the toolbar's own claim: Settings, Cloud Sync and Help are screens, so
|
| 571 |
580 |
|
/// reaching them is navigation rather than something the host arranges.
|
| 572 |
|
- |
fn panels(bar: Slot, state: &Panels<'_>) -> Slot {
|
|
581 |
+ |
fn panels(bar: Run, state: &Panels<'_>) -> Run {
|
| 573 |
582 |
|
use quasi_router::Tag;
|
| 574 |
583 |
|
|
| 575 |
584 |
|
let showing = state.bar.showing();
|