Move the filter bar and the timeline onto the library's Slint global

The date-range fields and their band on the capture-time axis, the
timeline's bars, labels, scrub/pinch/pan/zoom callbacks and its
sweep/current-bucket/anchored state, and the filter bar's people chips,
mode, eyes-open toggle and gesture reference move from AppWindow onto the
`Library` global. Rust reaches them through window.global::<Library>()
rather than window.set_/get_/on_ on the root, as the earlier commits on
this branch did for the grid's cells, selection, ratings and keywords.
This commit is contained in:
2026-09-20 22:07:12 +02:00
parent 00e2fe6aaf
commit 6bf67cefc4
11 changed files with 488 additions and 424 deletions
File diff suppressed because one or more lines are too long
+26 -26
View File
@@ -25,7 +25,7 @@ Sampling a neutral is the first move of the tonal pass — every colour judgemen
Anchored on the fingers' midpoint, and on the pointer, so the gesture reads as magnifying the picture rather than sliding it about. Double-tap is the way to an exact 1:1; this is the way to everything in between. Anchored on the fingers' midpoint, and on the pointer, so the gesture reads as magnifying the picture rather than sliding it about. Double-tap is the way to an exact 1:1; this is the way to everything in between.
<sub>`ui/dr-ui/ui/app.slint:1873`</sub> <sub>`ui/dr-ui/ui/app.slint:1825`</sub>
### Move a magnified photograph about ### Move a magnified photograph about
@@ -34,7 +34,7 @@ Anchored on the fingers' midpoint, and on the pointer, so the gesture reads as m
Only once there is something outside the viewport to reach, which is why the cursor becomes a hand exactly then. The view is clamped to the frame: panning past the edge would show undefined area beside the photograph, and that reads as a rendering fault rather than as the end of the picture. Only once there is something outside the viewport to reach, which is why the cursor becomes a hand exactly then. The view is clamped to the frame: panning past the edge would show undefined area beside the photograph, and that reads as a rendering fault rather than as the end of the picture.
<sub>`ui/dr-ui/ui/app.slint:1964`</sub> <sub>`ui/dr-ui/ui/app.slint:1916`</sub>
### Paint a mask by hand ### Paint a mask by hand
@@ -43,7 +43,7 @@ Only once there is something outside the viewport to reach, which is why the cur
A model's mask stops inside a shoulder and leaks into the hair, and no single edge control fixes two errors that go opposite ways. The whole stroke is one step in the history, so taking a mark back costs one press however long it took to make. A model's mask stops inside a shoulder and leaks into the hair, and no single edge control fixes two errors that go opposite ways. The whole stroke is one step in the history, so taking a mark back costs one press however long it took to make.
<sub>`ui/dr-ui/ui/app.slint:2051`</sub> <sub>`ui/dr-ui/ui/app.slint:2003`</sub>
### Take back the last change ### Take back the last change
@@ -53,7 +53,7 @@ A model's mask stops inside a shoulder and leaks into the hair, and no single ed
A whole drag is one step, so undo takes back a decision rather than a frame of a gesture. The list is there because arriving six steps back costs what arriving from one does. A whole drag is one step, so undo takes back a decision rather than a frame of a gesture. The list is there because arriving six steps back costs what arriving from one does.
<sub>`ui/dr-ui/ui/app.slint:2272`</sub> <sub>`ui/dr-ui/ui/app.slint:2224`</sub>
### Do it again after taking it back ### Do it again after taking it back
@@ -61,7 +61,7 @@ A whole drag is one step, so undo takes back a decision rather than a frame of a
- **Pointer** — Click it, or press Redo in the History header - **Pointer** — Click it, or press Redo in the History header
- **Keyboard** — Ctrl+Shift+Z - **Keyboard** — Ctrl+Shift+Z
<sub>`ui/dr-ui/ui/app.slint:2285`</sub> <sub>`ui/dr-ui/ui/app.slint:2237`</sub>
### Copy the settings from this photograph ### Copy the settings from this photograph
@@ -71,7 +71,7 @@ A whole drag is one step, so undo takes back a decision rather than a frame of a
The panel is the copy that has to work: a tablet has no modifier key to hold and no menu bar to hang the action from. The shortcut is an accelerator for a control that is on screen either way. The panel is the copy that has to work: a tablet has no modifier key to hold and no menu bar to hang the action from. The shortcut is an accelerator for a control that is on screen either way.
<sub>`ui/dr-ui/ui/app.slint:2318`</sub> <sub>`ui/dr-ui/ui/app.slint:2270`</sub>
### Paste the settings onto this photograph ### Paste the settings onto this photograph
@@ -81,7 +81,7 @@ The panel is the copy that has to work: a tablet has no modifier key to hold and
The button names what would be pasted — "3 adjustments", and whether the crop is coming with it — which the shortcut cannot say. Both paste the same scope. The button names what would be pasted — "3 adjustments", and whether the crop is coming with it — which the shortcut cannot say. Both paste the same scope.
<sub>`ui/dr-ui/ui/app.slint:2330`</sub> <sub>`ui/dr-ui/ui/app.slint:2282`</sub>
### Change which group of adjustments is on screen ### Change which group of adjustments is on screen
@@ -91,7 +91,7 @@ The button names what would be pasted — "3 adjustments", and whether the crop
The groups are whatever the operation set declares itself to be about, so there are as many as the pipeline has and no key can be assigned to one of them by name. Stepping is the binding that survives a node being added. The groups are whatever the operation set declares itself to be about, so there are as many as the pipeline has and no key can be assigned to one of them by name. Stepping is the binding that survives a node being added.
<sub>`ui/dr-ui/ui/app.slint:2358`</sub> <sub>`ui/dr-ui/ui/app.slint:2310`</sub>
### Look at the photograph at 1:1 ### Look at the photograph at 1:1
@@ -101,7 +101,7 @@ The groups are whatever the operation set declares itself to be about, so there
Noise reduction and capture sharpening are judgements about single pixels, and a fitted view averages several of the file's into each one on screen — so the frame looks softer than it is and the correction goes too far. The point and the magnification survive opening the next photograph, which is what makes checking the same eye across forty portraits forty keystrokes rather than forty pans. Noise reduction and capture sharpening are judgements about single pixels, and a fitted view averages several of the file's into each one on screen — so the frame looks softer than it is and the correction goes too far. The point and the magnification survive opening the next photograph, which is what makes checking the same eye across forty portraits forty keystrokes rather than forty pans.
<sub>`ui/dr-ui/ui/app.slint:2393`</sub> <sub>`ui/dr-ui/ui/app.slint:2345`</sub>
### Move to the next or previous photograph ### Move to the next or previous photograph
@@ -111,7 +111,7 @@ Noise reduction and capture sharpening are judgements about single pixels, and a
The edit on screen is saved on the way out, so stepping through a folder is as much a departure as going back to the grid and loses nothing. The edit on screen is saved on the way out, so stepping through a folder is as much a departure as going back to the grid and loses nothing.
<sub>`ui/dr-ui/ui/app.slint:2445`</sub> <sub>`ui/dr-ui/ui/app.slint:2397`</sub>
### See the photograph before you edited it ### See the photograph before you edited it
@@ -121,7 +121,7 @@ The edit on screen is saved on the way out, so stepping through a folder is as m
Held rather than toggled, and no split screen: a split halves the working image on the tablet the column was sized for, and the comparison photographers describe making is a flick back and forth. It takes no history step, so checking whether a frame is overcooked costs nothing to undo afterwards. Held rather than toggled, and no split screen: a split halves the working image on the tablet the column was sized for, and the comparison photographers describe making is a flick back and forth. It takes no history step, so checking whether a frame is overcooked costs nothing to undo afterwards.
<sub>`ui/dr-ui/ui/app.slint:2569`</sub> <sub>`ui/dr-ui/ui/app.slint:2521`</sub>
### Put one control back to its default ### Put one control back to its default
@@ -264,7 +264,7 @@ The right match confidence is a property of your library, not of the model. "Wha
Touch has no ctrl, so without a mode there is no way to select a second photograph — the first tap would open it. The hold is the fast way in and the button is the one that can be found. Touch has no ctrl, so without a mode there is no way to select a second photograph — the first tap would open it. The hold is the fast way in and the button is the one that can be found.
<sub>`ui/dr-ui/ui/library.slint:1471`</sub> <sub>`ui/dr-ui/ui/library.slint:1519`</sub>
### Add or remove one photograph ### Add or remove one photograph
@@ -273,7 +273,7 @@ Touch has no ctrl, so without a mode there is no way to select a second photogra
While selecting, a tap never opens. That is the whole point of the mode: one meaning per gesture at a time. Press Done to get tap-to-open back. While selecting, a tap never opens. That is the whole point of the mode: one meaning per gesture at a time. Press Done to get tap-to-open back.
<sub>`ui/dr-ui/ui/library.slint:1480`</sub> <sub>`ui/dr-ui/ui/library.slint:1528`</sub>
### Leave selecting ### Leave selecting
@@ -281,7 +281,7 @@ While selecting, a tap never opens. That is the whole point of the mode: one mea
- **Pointer** — Press Done in the header - **Pointer** — Press Done in the header
- **Keyboard** — Escape - **Keyboard** — Escape
<sub>`ui/dr-ui/ui/library.slint:1488`</sub> <sub>`ui/dr-ui/ui/library.slint:1536`</sub>
### Pick a photograph up to drag it ### Pick a photograph up to drag it
@@ -290,7 +290,7 @@ While selecting, a tap never opens. That is the whole point of the mode: one mea
A finger on a photograph might be starting a scroll, and for the first half-second the grid assumes it is. Holding says otherwise, and the ring is the grid saying it heard — from there the drag cannot be lost to a scroll. A mouse never waits: the cursor is precise enough that a sideways drag is unambiguous from the first pixel. A finger on a photograph might be starting a scroll, and for the first half-second the grid assumes it is. Holding says otherwise, and the ring is the grid saying it heard — from there the drag cannot be lost to a scroll. A mouse never waits: the cursor is precise enough that a sideways drag is unambiguous from the first pixel.
<sub>`ui/dr-ui/ui/library.slint:1518`</sub> <sub>`ui/dr-ui/ui/library.slint:1566`</sub>
### Select a range ### Select a range
@@ -299,7 +299,7 @@ A finger on a photograph might be starting a scroll, and for the first half-seco
This replaced a double tap, which had no visible state and could take forty photographs by accident. The run is resolved by the catalog rather than by what is on screen, so the grid can scroll between the two taps — the ranges that hurt on a tablet are longer than a screenful, which is exactly where a finger sweep runs out. This replaced a double tap, which had no visible state and could take forty photographs by accident. The run is resolved by the catalog rather than by what is on screen, so the grid can scroll between the two taps — the ranges that hurt on a tablet are longer than a screenful, which is exactly where a finger sweep runs out.
<sub>`ui/dr-ui/ui/library.slint:1583`</sub> <sub>`ui/dr-ui/ui/library.slint:1631`</sub>
### Take the blinks out of a burst ### Take the blinks out of a burst
@@ -308,7 +308,7 @@ This replaced a double tap, which had no visible state and could take forty phot
Face indexing reads each face's eyes. The chip drops frames where the chosen people are caught blinking, and leaves sunglasses and eyes it could not read alone. Face indexing reads each face's eyes. The chip drops frames where the chosen people are caught blinking, and leaves sunglasses and eyes it could not read alone.
<sub>`ui/dr-ui/ui/library.slint:2275`</sub> <sub>`ui/dr-ui/ui/library.slint:2323`</sub>
### Find photographs with two people in them ### Find photographs with two people in them
@@ -317,7 +317,7 @@ Face indexing reads each face's eyes. The chip drops frames where the chosen peo
"Any of them" is a union and "all of them" is an intersection. The tray is where both terms and the choice between them live, because a filter belongs on the filter bar. "Any of them" is a union and "all of them" is an intersection. The tray is where both terms and the choice between them live, because a filter belongs on the filter bar.
<sub>`ui/dr-ui/ui/library.slint:2304`</sub> <sub>`ui/dr-ui/ui/library.slint:2352`</sub>
### Resize the thumbnails ### Resize the thumbnails
@@ -326,7 +326,7 @@ Face indexing reads each face's eyes. The chip drops frames where the chosen peo
There is no wheel on a tablet, so without the pinch the cell size could only be changed by a control a finger cannot reach. There is no wheel on a tablet, so without the pinch the cell size could only be changed by a control a finger cannot reach.
<sub>`ui/dr-ui/ui/library.slint:2964`</sub> <sub>`ui/dr-ui/ui/library.slint:3012`</sub>
### File photographs in a collection ### File photographs in a collection
@@ -335,7 +335,7 @@ There is no wheel on a tablet, so without the pinch the cell size could only be
The selection is what the drag carries, which is why selecting several is worth the mode: forty photographs file in one gesture. The selection is what the drag carries, which is why selecting several is worth the mode: forty photographs file in one gesture.
<sub>`ui/dr-ui/ui/library.slint:3161`</sub> <sub>`ui/dr-ui/ui/library.slint:3209`</sub>
### Open a photograph ### Open a photograph
@@ -344,7 +344,7 @@ The selection is what the drag carries, which is why selecting several is worth
A tap opens; a tap that *moved* does not. Travel is what separates a deliberate tap from a hand brushing past, and it is the only thing that does: the two are the same length. An earlier version required the finger to dwell 120 ms instead, and that rejected ordinary taps — a real tap is often quicker than a brush. A tap opens; a tap that *moved* does not. Travel is what separates a deliberate tap from a hand brushing past, and it is the only thing that does: the two are the same length. An earlier version required the finger to dwell 120 ms instead, and that rejected ordinary taps — a real tap is often quicker than a brush.
<sub>`ui/dr-ui/ui/library.slint:3429`</sub> <sub>`ui/dr-ui/ui/library.slint:3477`</sub>
### Rate a photograph without opening it ### Rate a photograph without opening it
@@ -354,7 +354,7 @@ A tap opens; a tap that *moved* does not. Travel is what separates a deliberate
A star has to take the press without it also reaching the cell, or every rating throws the user into develop. A star has to take the press without it also reaching the cell, or every rating throws the user into develop.
<sub>`ui/dr-ui/ui/library.slint:3549`</sub> <sub>`ui/dr-ui/ui/library.slint:3597`</sub>
### Choose the frame a folded burst shows ### Choose the frame a folded burst shows
@@ -363,7 +363,7 @@ A star has to take the press without it also reaching the cell, or every rating
A folded burst draws its earliest frame, which is a fact about the clock and not a judgement about the photograph — nothing in this application ranks a frame (FR-CULL-5). But the point of a burst is that one of the twelve is better than the other eleven, and the photographer is the only one who knows which. So the choice is offered on the frames themselves, while they are open and side by side, which is the one moment the alternatives are on screen to be compared. A folded burst draws its earliest frame, which is a fact about the clock and not a judgement about the photograph — nothing in this application ranks a frame (FR-CULL-5). But the point of a burst is that one of the twelve is better than the other eleven, and the photographer is the only one who knows which. So the choice is offered on the frames themselves, while they are open and side by side, which is the one moment the alternatives are on screen to be compared.
<sub>`ui/dr-ui/ui/library.slint:3680`</sub> <sub>`ui/dr-ui/ui/library.slint:3728`</sub>
### Drop the selection but keep selecting ### Drop the selection but keep selecting
@@ -372,7 +372,7 @@ A folded burst draws its earliest frame, which is a fact about the clock and not
Distinct from Done, which leaves the mode entirely. Clearing keeps it, so the next selection can start straight away. Distinct from Done, which leaves the mode entirely. Clearing keeps it, so the next selection can start straight away.
<sub>`ui/dr-ui/ui/library.slint:4346`</sub> <sub>`ui/dr-ui/ui/library.slint:4394`</sub>
### Select everything the grid is showing ### Select everything the grid is showing
@@ -381,7 +381,7 @@ Distinct from Done, which leaves the mode entirely. Clearing keeps it, so the ne
A scoped grid of two hundred frames is two hundred taps otherwise, and "all of them, except those three" is a far more common shape than the taps it took to say it. A scoped grid of two hundred frames is two hundred taps otherwise, and "all of them, except those three" is a far more common shape than the taps it took to say it.
<sub>`ui/dr-ui/ui/library.slint:4363`</sub> <sub>`ui/dr-ui/ui/library.slint:4411`</sub>
### Take photographs out of a collection ### Take photographs out of a collection
@@ -390,4 +390,4 @@ A scoped grid of two hundred frames is two hundred taps otherwise, and "all of t
The badge on a cell says a photograph is filed in three collections and never which. This is the sheet that names them, and the only way out of one the grid is not currently scoped to. The badge on a cell says a photograph is filed in three collections and never which. This is the sheet that names them, and the only way out of one the grid is not currently scoped to.
<sub>`ui/dr-ui/ui/library.slint:4487`</sub> <sub>`ui/dr-ui/ui/library.slint:4535`</sub>
+1 -1
View File
@@ -112,7 +112,7 @@ fn wire_selection(
// Where the window starts, so the press is recorded as the ordinal // Where the window starts, so the press is recorded as the ordinal
// it is rather than as a row that stops meaning this photograph on // it is rather than as a row that stops meaning this photograph on
// the next scroll. // the next scroll.
let offset = w.get_library_offset().max(0) as usize; let offset = w.global::<Library>().get_library_offset().max(0) as usize;
select_row(&w, &ctl, &ids, offset, row as usize, ctrl_held, shift_held); select_row(&w, &ctl, &ids, offset, row as usize, ctrl_held, shift_held);
// TRACES: FR-UI-2 | FR-UI-4 | FR-CAT-7 // TRACES: FR-UI-2 | FR-UI-4 | FR-CAT-7
+51 -22
View File
@@ -107,7 +107,9 @@ pub(super) fn wire_filter_ratings_and_people(window: &AppWindow, ctl: &Rc<Librar
{ {
let weak = window.as_weak(); let weak = window.as_weak();
let ctl = ctl.clone(); let ctl = ctl.clone();
window.on_library_filter_person_cleared(move |id| { window
.global::<Library>()
.on_library_filter_person_cleared(move |id| {
let Some(w) = weak.upgrade() else { return }; let Some(w) = weak.upgrade() else { return };
ctl.filter ctl.filter
.borrow_mut() .borrow_mut()
@@ -122,7 +124,9 @@ pub(super) fn wire_filter_ratings_and_people(window: &AppWindow, ctl: &Rc<Librar
{ {
let weak = window.as_weak(); let weak = window.as_weak();
let ctl = ctl.clone(); let ctl = ctl.clone();
window.on_library_people_listed(move || { window
.global::<Library>()
.on_library_people_listed(move || {
let Some(w) = weak.upgrade() else { return }; let Some(w) = weak.upgrade() else { return };
push_people_roster(&w, &ctl); push_people_roster(&w, &ctl);
}); });
@@ -131,7 +135,9 @@ pub(super) fn wire_filter_ratings_and_people(window: &AppWindow, ctl: &Rc<Librar
{ {
let weak = window.as_weak(); let weak = window.as_weak();
let ctl = ctl.clone(); let ctl = ctl.clone();
window.on_library_filter_person_toggled(move |id| { window
.global::<Library>()
.on_library_filter_person_toggled(move |id| {
let Some(w) = weak.upgrade() else { return }; let Some(w) = weak.upgrade() else { return };
let person = id.max(0) as u64; let person = id.max(0) as u64;
{ {
@@ -151,14 +157,16 @@ pub(super) fn wire_filter_ratings_and_people(window: &AppWindow, ctl: &Rc<Librar
{ {
let weak = window.as_weak(); let weak = window.as_weak();
let ctl = ctl.clone(); let ctl = ctl.clone();
window.on_library_filter_eyes_open_toggled(move || { window
.global::<Library>()
.on_library_filter_eyes_open_toggled(move || {
let Some(w) = weak.upgrade() else { return }; let Some(w) = weak.upgrade() else { return };
let on = { let on = {
let mut f = ctl.filter.borrow_mut(); let mut f = ctl.filter.borrow_mut();
f.eyes_open = !f.eyes_open; f.eyes_open = !f.eyes_open;
f.eyes_open f.eyes_open
}; };
w.set_library_filter_eyes_open(on); w.global::<Library>().set_library_filter_eyes_open(on);
refilter(&w, &ctl); refilter(&w, &ctl);
}); });
} }
@@ -166,7 +174,9 @@ pub(super) fn wire_filter_ratings_and_people(window: &AppWindow, ctl: &Rc<Librar
{ {
let weak = window.as_weak(); let weak = window.as_weak();
let ctl = ctl.clone(); let ctl = ctl.clone();
window.on_library_filter_people_mode_toggled(move || { window
.global::<Library>()
.on_library_filter_people_mode_toggled(move || {
let Some(w) = weak.upgrade() else { return }; let Some(w) = weak.upgrade() else { return };
{ {
let mut f = ctl.filter.borrow_mut(); let mut f = ctl.filter.borrow_mut();
@@ -227,14 +237,16 @@ pub(super) fn wire_filter_dates(window: &AppWindow, ctl: &Rc<LibraryController>)
{ {
let weak = window.as_weak(); let weak = window.as_weak();
let ctl = ctl.clone(); let ctl = ctl.clone();
window.on_library_toggle_date_range(move || { window
.global::<Library>()
.on_library_toggle_date_range(move || {
let Some(w) = weak.upgrade() else { return }; let Some(w) = weak.upgrade() else { return };
// Whether the *controls* are showing, which is not the same as // Whether the *controls* are showing, which is not the same as
// whether a range is set — and reading it from the filter was why // whether a range is set — and reading it from the filter was why
// pressing this did nothing. The fields are how a range gets set, // pressing this did nothing. The fields are how a range gets set,
// so requiring one before they appear is a door locked from the // so requiring one before they appear is a door locked from the
// inside. // inside.
let on = !w.get_library_range_active(); let on = !w.global::<Library>().get_library_range_active();
if on { if on {
// Seeded from the span the axis is drawn over, which is what // Seeded from the span the axis is drawn over, which is what
// the user is looking at when they ask for "this range". // the user is looking at when they ask for "this range".
@@ -274,7 +286,7 @@ pub(super) fn wire_filter_dates(window: &AppWindow, ctl: &Rc<LibraryController>)
f.captured_from = None; f.captured_from = None;
f.captured_to = None; f.captured_to = None;
} }
w.set_library_range_active(on); w.global::<Library>().set_library_range_active(on);
show_range(&w, &ctl); show_range(&w, &ctl);
refilter(&w, &ctl); refilter(&w, &ctl);
}); });
@@ -298,7 +310,9 @@ pub(super) fn wire_filter_dates(window: &AppWindow, ctl: &Rc<LibraryController>)
{ {
let weak = window.as_weak(); let weak = window.as_weak();
let ctl = ctl.clone(); let ctl = ctl.clone();
window.on_library_timeline_range_changed(move |a, b| { window
.global::<Library>()
.on_library_timeline_range_changed(move |a, b| {
let Some(w) = weak.upgrade() else { return }; let Some(w) = weak.upgrade() else { return };
let borrow = ctl.catalog.borrow(); let borrow = ctl.catalog.borrow();
let Some(catalog) = borrow.as_ref() else { let Some(catalog) = borrow.as_ref() else {
@@ -323,8 +337,8 @@ pub(super) fn wire_filter_dates(window: &AppWindow, ctl: &Rc<LibraryController>)
// A dragged range cannot be mistyped, so any standing complaint // A dragged range cannot be mistyped, so any standing complaint
// about the fields is now about a range that no longer exists. // about the fields is now about a range that no longer exists.
w.set_library_range_invalid(false); w.global::<Library>().set_library_range_invalid(false);
w.set_library_range_active(true); w.global::<Library>().set_library_range_active(true);
show_range(&w, &ctl); show_range(&w, &ctl);
// Reloads the window, and `load_window` redraws the timeline — // Reloads the window, and `load_window` redraws the timeline —
// which is what puts the band back under the finger that dropped // which is what puts the band back under the finger that dropped
@@ -343,7 +357,9 @@ pub(super) fn wire_filter_dates(window: &AppWindow, ctl: &Rc<LibraryController>)
{ {
let weak = window.as_weak(); let weak = window.as_weak();
let ctl = ctl.clone(); let ctl = ctl.clone();
window.on_library_range_edited(move |from, to| { window
.global::<Library>()
.on_library_range_edited(move |from, to| {
let Some(w) = weak.upgrade() else { return }; let Some(w) = weak.upgrade() else { return };
// Both ends, or neither. A range with one end parsed and the other // Both ends, or neither. A range with one end parsed and the other
@@ -353,7 +369,7 @@ pub(super) fn wire_filter_dates(window: &AppWindow, ctl: &Rc<LibraryController>)
dr_types::parse_date(from.as_str()), dr_types::parse_date(from.as_str()),
dr_types::parse_date(to.as_str()), dr_types::parse_date(to.as_str()),
) else { ) else {
w.set_library_range_invalid(true); w.global::<Library>().set_library_range_invalid(true);
return; return;
}; };
@@ -371,8 +387,8 @@ pub(super) fn wire_filter_dates(window: &AppWindow, ctl: &Rc<LibraryController>)
// the user named. The same rule `dragged_range` applies. // the user named. The same rule `dragged_range` applies.
f.captured_to = Some(to + 86_400 - 1); f.captured_to = Some(to + 86_400 - 1);
} }
w.set_library_range_invalid(false); w.global::<Library>().set_library_range_invalid(false);
w.set_library_range_active(true); w.global::<Library>().set_library_range_active(true);
show_range(&w, &ctl); show_range(&w, &ctl);
refilter(&w, &ctl); refilter(&w, &ctl);
}); });
@@ -511,7 +527,9 @@ fn drop_eyes_open_without_people(window: &AppWindow, ctl: &Rc<LibraryController>
let mut f = ctl.filter.borrow_mut(); let mut f = ctl.filter.borrow_mut();
if f.people.is_empty() && f.eyes_open { if f.people.is_empty() && f.eyes_open {
f.eyes_open = false; f.eyes_open = false;
window.set_library_filter_eyes_open(false); window
.global::<Library>()
.set_library_filter_eyes_open(false);
} }
} }
@@ -519,6 +537,7 @@ pub(super) fn push_people_chips(window: &AppWindow, ctl: &Rc<LibraryController>)
let ids = ctl.filter.borrow().people.clone(); let ids = ctl.filter.borrow().people.clone();
if ids.is_empty() { if ids.is_empty() {
window window
.global::<Library>()
.set_library_filter_people(slint::ModelRc::new(slint::VecModel::from( .set_library_filter_people(slint::ModelRc::new(slint::VecModel::from(
Vec::<PersonChip>::new(), Vec::<PersonChip>::new(),
))); )));
@@ -563,8 +582,12 @@ pub(super) fn push_people_chips(window: &AppWindow, ctl: &Rc<LibraryController>)
}) })
.collect(); .collect();
window.set_library_filter_people(slint::ModelRc::new(slint::VecModel::from(chips))); window
window.set_library_filter_people_all(matches!( .global::<Library>()
.set_library_filter_people(slint::ModelRc::new(slint::VecModel::from(chips)));
window
.global::<Library>()
.set_library_filter_people_all(matches!(
ctl.filter.borrow().people_mode, ctl.filter.borrow().people_mode,
library::PeopleMode::All library::PeopleMode::All
)); ));
@@ -632,7 +655,9 @@ fn push_people_roster(window: &AppWindow, ctl: &Rc<LibraryController>) {
rows.sort_by_key(|(unnamed, faces, _)| (*unnamed, -faces)); rows.sort_by_key(|(unnamed, faces, _)| (*unnamed, -faces));
let rows: Vec<PersonChip> = rows.into_iter().map(|(_, _, chip)| chip).collect(); let rows: Vec<PersonChip> = rows.into_iter().map(|(_, _, chip)| chip).collect();
window.set_library_people(slint::ModelRc::new(slint::VecModel::from(rows))); window
.global::<Library>()
.set_library_people(slint::ModelRc::new(slint::VecModel::from(rows)));
} }
pub(super) fn refilter(window: &AppWindow, ctl: &Rc<LibraryController>) { pub(super) fn refilter(window: &AppWindow, ctl: &Rc<LibraryController>) {
@@ -698,10 +723,14 @@ fn show_range(window: &AppWindow, ctl: &Rc<LibraryController>) {
let text = |t: Option<i64>| -> slint::SharedString { let text = |t: Option<i64>| -> slint::SharedString {
t.map(dr_types::format_date).unwrap_or_default().into() t.map(dr_types::format_date).unwrap_or_default().into()
}; };
window.set_library_range_from(text(f.captured_from)); window
.global::<Library>()
.set_library_range_from(text(f.captured_from));
// The stored end is the last second of the closing day; naming that day is // The stored end is the last second of the closing day; naming that day is
// what the user typed and what they should read back. // what the user typed and what they should read back.
window.set_library_range_to(text(f.captured_to.map(|t| t - 86_400 + 1))); window
.global::<Library>()
.set_library_range_to(text(f.captured_to.map(|t| t - 86_400 + 1)));
} }
#[cfg(test)] #[cfg(test)]
+7 -4
View File
@@ -184,7 +184,9 @@ pub fn wire<F>(
// table is a compiled-in constant, so there is nothing to be fresh about // table is a compiled-in constant, so there is nothing to be fresh about
// and nothing to recompute — a callback to fill it would only be a way for // and nothing to recompute — a callback to fill it would only be a way for
// it to be empty the first time the sheet opens. // it to be empty the first time the sheet opens.
window.set_library_gestures(slint::ModelRc::new(slint::VecModel::from( window
.global::<Library>()
.set_library_gestures(slint::ModelRc::new(slint::VecModel::from(
crate::gestures::rows() crate::gestures::rows()
.into_iter() .into_iter()
.map(|r| GestureRow { .map(|r| GestureRow {
@@ -621,12 +623,13 @@ fn wire_grid_sync_and_load(window: &AppWindow, ctl: &Rc<LibraryController>) {
let centre = *ctl.timeline_centre.borrow(); let centre = *ctl.timeline_centre.borrow();
if let Some(full) = catalog_span(catalog, &ctl) { if let Some(full) = catalog_span(catalog, &ctl) {
let (from, to) = zoomed_span(full, zoom, centre); let (from, to) = zoomed_span(full, zoom, centre);
w.set_library_current_bucket(when as i32); w.global::<Library>()
w.set_library_current_fraction( .set_library_current_bucket(when as i32);
w.global::<Library>().set_library_current_fraction(
((when - from) as f64 / (to - from).max(1) as f64) ((when - from) as f64 / (to - from).max(1) as f64)
.clamp(0.0, 1.0) as f32, .clamp(0.0, 1.0) as f32,
); );
w.set_library_timeline_anchored(true); w.global::<Library>().set_library_timeline_anchored(true);
} }
} }
} }
+3 -1
View File
@@ -85,7 +85,9 @@ pub fn open(
window.set_library_status("Starting…".into()); window.set_library_status("Starting…".into());
// Always visible: two folders one letter apart are easy to confuse, and a // Always visible: two folders one letter apart are easy to confuse, and a
// scan of the wrong one is indistinguishable from a broken scan. // scan of the wrong one is indistinguishable from a broken scan.
window.set_library_root_label(library_root_label(&conn.account).into()); window
.global::<Library>()
.set_library_root_label(library_root_label(&conn.account).into());
// An empty filter would walk the whole tree and match nothing, which looks // An empty filter would walk the whole tree and match nothing, which looks
// exactly like a broken scan. Say so instead. // exactly like a broken scan. Say so instead.
+10 -7
View File
@@ -12,7 +12,7 @@ use std::rc::Rc;
use slint::ComponentHandle; use slint::ComponentHandle;
use crate::library; use crate::library;
use crate::AppWindow; use crate::{AppWindow, Library};
use super::controller::{stop, LibraryController}; use super::controller::{stop, LibraryController};
use super::open::schedule_reload; use super::open::schedule_reload;
@@ -302,7 +302,7 @@ pub(super) fn start_sweep(window: &AppWindow, ctl: &Rc<LibraryController>) {
Ok(m) => m, Ok(m) => m,
Err(std::sync::mpsc::TryRecvError::Empty) => return, Err(std::sync::mpsc::TryRecvError::Empty) => return,
Err(std::sync::mpsc::TryRecvError::Disconnected) => { Err(std::sync::mpsc::TryRecvError::Disconnected) => {
w.set_library_sweep_total(0); w.global::<Library>().set_library_sweep_total(0);
job.fail("stopped without finishing"); job.fail("stopped without finishing");
stop(&ctl_cb.sweep_timer); stop(&ctl_cb.sweep_timer);
return; return;
@@ -311,13 +311,16 @@ pub(super) fn start_sweep(window: &AppWindow, ctl: &Rc<LibraryController>) {
match msg { match msg {
library::SweepMessage::Total(n) => { library::SweepMessage::Total(n) => {
w.set_library_sweep_total(n as i32); w.global::<Library>().set_library_sweep_total(n as i32);
w.set_library_sweep_done(0); w.global::<Library>().set_library_sweep_done(0);
job.total(n); job.total(n);
} }
library::SweepMessage::Progress { done, dated } => { library::SweepMessage::Progress { done, dated } => {
w.set_library_sweep_done(done as i32); w.global::<Library>().set_library_sweep_done(done as i32);
job.progress(done, w.get_library_sweep_total() as usize); job.progress(
done,
w.global::<Library>().get_library_sweep_total() as usize,
);
// Rebuild as it goes: the histogram growing while the // Rebuild as it goes: the histogram growing while the
// sweep runs is the visible sign it is working. // sweep runs is the visible sign it is working.
if dated > 0 { if dated > 0 {
@@ -330,7 +333,7 @@ pub(super) fn start_sweep(window: &AppWindow, ctl: &Rc<LibraryController>) {
library::SweepMessage::Finished { dated } => { library::SweepMessage::Finished { dated } => {
log::info!("sweep finished: {dated} dated"); log::info!("sweep finished: {dated} dated");
job.finish(format!("{dated} dated")); job.finish(format!("{dated} dated"));
w.set_library_sweep_total(0); w.global::<Library>().set_library_sweep_total(0);
{ {
let borrow = ctl_cb.catalog.borrow(); let borrow = ctl_cb.catalog.borrow();
if let Some(catalog) = borrow.as_ref() { if let Some(catalog) = borrow.as_ref() {
+40 -13
View File
@@ -95,8 +95,12 @@ pub(super) fn refresh_timeline(window: &AppWindow, catalog: &Catalog, ctl: &Rc<L
None => { None => {
// No dated images yet. An empty histogram is honest — EXIF is read // No dated images yet. An empty histogram is honest — EXIF is read
// as thumbnails load, so this populates as the user browses. // as thumbnails load, so this populates as the user browses.
window.set_library_timeline(slint::ModelRc::new(slint::VecModel::from(vec![]))); window
window.set_library_timeline_label(slint::SharedString::new()); .global::<Library>()
.set_library_timeline(slint::ModelRc::new(slint::VecModel::from(vec![])));
window
.global::<Library>()
.set_library_timeline_label(slint::SharedString::new());
return; return;
} }
}; };
@@ -206,14 +210,27 @@ pub(super) fn refresh_timeline(window: &AppWindow, catalog: &Catalog, ctl: &Rc<L
buckets.get(i).map(|b| b.start) buckets.get(i).map(|b| b.start)
}) })
.unwrap_or(0); .unwrap_or(0);
window.set_library_current_bucket(lit as i32);
window.set_library_current_fraction(fraction);
window.set_library_range_from_fraction(band_from);
window.set_library_range_to_fraction(band_to);
window.set_library_timeline_anchored(current.is_some());
window window
.global::<Library>()
.set_library_current_bucket(lit as i32);
window
.global::<Library>()
.set_library_current_fraction(fraction);
window
.global::<Library>()
.set_library_range_from_fraction(band_from);
window
.global::<Library>()
.set_library_range_to_fraction(band_to);
window
.global::<Library>()
.set_library_timeline_anchored(current.is_some());
window
.global::<Library>()
.set_library_timeline_label(format!("{} – {}", format_date(from), format_date(to)).into()); .set_library_timeline_label(format!("{} – {}", format_date(from), format_date(to)).into());
window.set_library_timeline(slint::ModelRc::new(slint::VecModel::from(bars))); window
.global::<Library>()
.set_library_timeline(slint::ModelRc::new(slint::VecModel::from(bars)));
} }
/// Whether this bucket size is fine enough for month labels to mean anything. /// Whether this bucket size is fine enough for month labels to mean anything.
@@ -904,7 +921,9 @@ fn push_filter(window: &AppWindow, ctl: &Rc<LibraryController>) {
.global::<Library>() .global::<Library>()
.set_library_local_only(filter.local_only); .set_library_local_only(filter.local_only);
ctl.local_only.set(filter.local_only); ctl.local_only.set(filter.local_only);
window.set_library_filter_eyes_open(filter.eyes_open); window
.global::<Library>()
.set_library_filter_eyes_open(filter.eyes_open);
push_people_chips(window, ctl); push_people_chips(window, ctl);
} }
@@ -1019,7 +1038,9 @@ pub(super) fn wire_timeline(window: &AppWindow, ctl: &Rc<LibraryController>) {
{ {
let weak = window.as_weak(); let weak = window.as_weak();
let ctl = ctl.clone(); let ctl = ctl.clone();
window.on_library_timeline_pan(move |fraction| { window
.global::<Library>()
.on_library_timeline_pan(move |fraction| {
let Some(w) = weak.upgrade() else { return }; let Some(w) = weak.upgrade() else { return };
let borrow = ctl.catalog.borrow(); let borrow = ctl.catalog.borrow();
let Some(catalog) = borrow.as_ref() else { let Some(catalog) = borrow.as_ref() else {
@@ -1052,7 +1073,9 @@ pub(super) fn wire_timeline(window: &AppWindow, ctl: &Rc<LibraryController>) {
{ {
let weak = window.as_weak(); let weak = window.as_weak();
let ctl = ctl.clone(); let ctl = ctl.clone();
window.on_library_timeline_zoom(move |delta| { window
.global::<Library>()
.on_library_timeline_zoom(move |delta| {
if let Some(w) = weak.upgrade() { if let Some(w) = weak.upgrade() {
apply_zoom(&w, &ctl, delta); apply_zoom(&w, &ctl, delta);
} }
@@ -1067,7 +1090,9 @@ pub(super) fn wire_timeline(window: &AppWindow, ctl: &Rc<LibraryController>) {
{ {
let weak = window.as_weak(); let weak = window.as_weak();
let ctl = ctl.clone(); let ctl = ctl.clone();
window.on_library_scrub_fraction(move |f| { window
.global::<Library>()
.on_library_scrub_fraction(move |f| {
let Some(w) = weak.upgrade() else { return }; let Some(w) = weak.upgrade() else { return };
let borrow = ctl.catalog.borrow(); let borrow = ctl.catalog.borrow();
let Some(catalog) = borrow.as_ref() else { let Some(catalog) = borrow.as_ref() else {
@@ -1097,7 +1122,9 @@ pub(super) fn wire_timeline(window: &AppWindow, ctl: &Rc<LibraryController>) {
{ {
let weak = window.as_weak(); let weak = window.as_weak();
let ctl = ctl.clone(); let ctl = ctl.clone();
window.on_library_timeline_pinch(move |ratio| { window
.global::<Library>()
.on_library_timeline_pinch(move |ratio| {
let Some(w) = weak.upgrade() else { return }; let Some(w) = weak.upgrade() else { return };
if !(0.01..=100.0).contains(&ratio) { if !(0.01..=100.0).contains(&ratio) {
return; return;
+2 -2
View File
@@ -254,7 +254,7 @@ pub(super) fn load_window(window: &AppWindow, ctl: &Rc<LibraryController>) {
let window_size = *ctl.window.borrow(); let window_size = *ctl.window.borrow();
let offset = (*ctl.offset.borrow()).min(total.saturating_sub(window_size.min(total))); let offset = (*ctl.offset.borrow()).min(total.saturating_sub(window_size.min(total)));
*ctl.offset.borrow_mut() = offset; *ctl.offset.borrow_mut() = offset;
window.set_library_offset(offset as i32); window.global::<Library>().set_library_offset(offset as i32);
// The axis the scrubber draws. A `MIN`/`MAX` and a `GROUP BY` over the // The axis the scrubber draws. A `MIN`/`MAX` and a `GROUP BY` over the
// whole scope — 5.7 ms on 24,000 images — and the bars do not change as the // whole scope — 5.7 ms on 24,000 images — and the bars do not change as the
@@ -308,7 +308,7 @@ pub(super) fn load_window(window: &AppWindow, ctl: &Rc<LibraryController>) {
Some((lo, hi)) => (lo.min(t), hi.max(t)), Some((lo, hi)) => (lo.min(t), hi.max(t)),
}) })
}); });
window.set_library_window_label( window.global::<Library>().set_library_window_label(
match span { match span {
Some((lo, hi)) => format!("{} – {}", format_date(lo), format_date(hi)), Some((lo, hi)) => format!("{} – {}", format_date(lo), format_date(hi)),
// Nothing here has a date yet: EXIF is read as thumbnails load, so // Nothing here has a date yet: EXIF is read as thumbnails load, so
+34 -82
View File
@@ -337,20 +337,6 @@ export component AppWindow inherits Window {
in property <bool> library-offline: false; in property <bool> library-offline: false;
in property <string> library-offline-reason: ""; in property <string> library-offline-reason: "";
in property <string> library-offline-since: ""; in property <string> library-offline-since: "";
/// Whether the grid is narrowed to the timeline's visible span.
in-out property <bool> library-range-active: false;
callback library-toggle-date-range();
/// TRACES: FR-CAT-6
in property <string> library-range-from;
in property <string> library-range-to;
in property <bool> library-range-invalid: false;
callback library-range-edited(string, string);
/// The same range as a band on the capture-time axis, and the ends of it
/// dragged. Fractions of the span the axis is drawn over — Rust owns the
/// conversion both ways, so the band lands where the finger left it.
in property <float> library-range-from-fraction: -1;
in property <float> library-range-to-fraction: -1;
callback library-timeline-range-changed(float, float);
callback library-retry-connection(); callback library-retry-connection();
// --- pinning a collection offline (FR-NC-6a) --- // --- pinning a collection offline (FR-NC-6a) ---
@@ -388,23 +374,6 @@ export component AppWindow inherits Window {
callback recovery-rebuild(); callback recovery-rebuild();
callback recovery-dismiss(); callback recovery-dismiss();
in property <string> library-root-label: "";
in-out property <[TimelineBar]> library-timeline;
in property <string> library-timeline-label: "";
in property <string> library-window-label: "";
in property <int> library-offset: 0;
in property <int> library-sweep-done: 0;
in property <int> library-sweep-total: 0;
in property <int> library-current-bucket: 0;
in property <float> library-current-fraction: -1;
in property <bool> library-timeline-anchored: false;
callback library-scrub-fraction(float);
callback library-timeline-pinch(float);
callback library-timeline-pan(float);
callback library-timeline-zoom(int);
in property <bool> library-syncing: false; in property <bool> library-syncing: false;
/// TRACES: FR-CAT-3 | FR-NC-3 /// TRACES: FR-CAT-3 | FR-NC-3
/// The whole-library thumbnail pass, launched from the settings page. /// The whole-library thumbnail pass, launched from the settings page.
@@ -511,23 +480,6 @@ export component AppWindow inherits Window {
/// Whose photographs the grid is narrowed to, one entry each.
in property <[PersonChip]> library-filter-people;
/// Whether those people are an intersection rather than a union.
in property <bool> library-filter-people-all: false;
callback library-filter-person-cleared(int);
callback library-filter-people-mode-toggled();
/// TRACES: FR-CULL-8a | FR-CULL-13
/// Whether the grid is narrowed to photographs with nobody blinking.
in property <bool> library-filter-eyes-open: false;
callback library-filter-eyes-open-toggled();
/// Everyone the library knows, for the filter bar's people tray.
/// TRACES: FR-UI-4
/// The gesture reference's rows, read from the generated table.
in property <[GestureRow]> library-gestures;
in property <[PersonChip]> library-people;
callback library-people-listed();
callback library-filter-person-toggled(int);
callback next-image(); callback next-image();
@@ -1318,7 +1270,7 @@ in property <bool> panel-visible: true;
confirm-all() => { root.identity-confirm-all(); } confirm-all() => { root.identity-confirm-all(); }
split-picked() => { root.identity-split-picked(); } split-picked() => { root.identity-split-picked(); }
compact: !root.expanded; compact: !root.expanded;
photos-filtered: root.library-filter-people.length > 0; photos-filtered: Library.library-filter-people.length > 0;
regrouping: root.identity-regrouping; regrouping: root.identity-regrouping;
regroup-status: root.identity-regroup-status; regroup-status: root.identity-regroup-status;
merge-probability: root.identity-merge-probability; merge-probability: root.identity-merge-probability;
@@ -1471,8 +1423,8 @@ in property <bool> panel-visible: true;
local-only: Library.library-local-only; local-only: Library.library-local-only;
local-count: Library.library-local-count; local-count: Library.library-local-count;
toggle-local-only() => { Library.library-toggle-local-only(); } toggle-local-only() => { Library.library-toggle-local-only(); }
range-active: root.library-range-active; range-active: Library.library-range-active;
toggle-date-range() => { root.library-toggle-date-range(); } toggle-date-range() => { Library.library-toggle-date-range(); }
clear-selection() => { Library.library-clear-selection(); } clear-selection() => { Library.library-clear-selection(); }
select-all() => { Library.library-select-all(); } select-all() => { Library.library-select-all(); }
reorderable: Library.library-reorderable; reorderable: Library.library-reorderable;
@@ -1480,14 +1432,14 @@ in property <bool> panel-visible: true;
collection-from-selection(name) => { collection-from-selection(name) => {
Library.library-collection-from-selection(name); Library.library-collection-from-selection(name);
} }
range-from: root.library-range-from; range-from: Library.library-range-from;
range-to: root.library-range-to; range-to: Library.library-range-to;
range-invalid: root.library-range-invalid; range-invalid: Library.library-range-invalid;
range-edited(a, b) => { root.library-range-edited(a, b); } range-edited(a, b) => { Library.library-range-edited(a, b); }
range-from-fraction: root.library-range-from-fraction; range-from-fraction: Library.library-range-from-fraction;
range-to-fraction: root.library-range-to-fraction; range-to-fraction: Library.library-range-to-fraction;
timeline-range-changed(a, b) => { timeline-range-changed(a, b) => {
root.library-timeline-range-changed(a, b); Library.library-timeline-range-changed(a, b);
} }
collections-visible: root.collections-visible; collections-visible: root.collections-visible;
@@ -1495,11 +1447,11 @@ in property <bool> panel-visible: true;
pin-done: root.library-pin-done; pin-done: root.library-pin-done;
pin-total: root.library-pin-total; pin-total: root.library-pin-total;
root-label: root.library-root-label; root-label: Library.library-root-label;
timeline: root.library-timeline; timeline: Library.library-timeline;
timeline-label: root.library-timeline-label; timeline-label: Library.library-timeline-label;
window-label: root.library-window-label; window-label: Library.library-window-label;
offset: root.library-offset; offset: Library.library-offset;
selected-count: Library.library-selected-count; selected-count: Library.library-selected-count;
scope-label: Collections.collection-scope-label; scope-label: Collections.collection-scope-label;
settings-armed: Transfer.armed; settings-armed: Transfer.armed;
@@ -1524,17 +1476,17 @@ in property <bool> panel-visible: true;
// TRACES: FR-MRG-1 // TRACES: FR-MRG-1
merge-selection => { root.library-merge-selection(); } merge-selection => { root.library-merge-selection(); }
sweep-done: root.library-sweep-done; sweep-done: Library.library-sweep-done;
sweep-total: root.library-sweep-total; sweep-total: Library.library-sweep-total;
current-bucket: root.library-current-bucket; current-bucket: Library.library-current-bucket;
current-bucket-fraction: root.library-current-fraction; current-bucket-fraction: Library.library-current-fraction;
timeline-anchored: root.library-timeline-anchored; timeline-anchored: Library.library-timeline-anchored;
scrub-fraction(f) => { root.library-scrub-fraction(f); } scrub-fraction(f) => { Library.library-scrub-fraction(f); }
timeline-pinch(r) => { root.library-timeline-pinch(r); } timeline-pinch(r) => { Library.library-timeline-pinch(r); }
timeline-pan(d) => { root.library-timeline-pan(d); } timeline-pan(d) => { Library.library-timeline-pan(d); }
timeline-zoom(d) => { root.library-timeline-zoom(d); } timeline-zoom(d) => { Library.library-timeline-zoom(d); }
syncing: root.library-syncing; syncing: root.library-syncing;
requested-cell-size: Library.library-cell-size; requested-cell-size: Library.library-cell-size;
touched <=> Library.library-touched; touched <=> Library.library-touched;
@@ -1590,11 +1542,11 @@ in property <bool> panel-visible: true;
} }
open-membership() => { Library.library-open-membership(); } open-membership() => { Library.library-open-membership(); }
filter-people: root.library-filter-people; filter-people: Library.library-filter-people;
filter-people-all: root.library-filter-people-all; filter-people-all: Library.library-filter-people-all;
filter-eyes-open: root.library-filter-eyes-open; filter-eyes-open: Library.library-filter-eyes-open;
people: root.library-people; people: Library.library-people;
gestures: root.library-gestures; gestures: Library.library-gestures;
filter-min-rating: Library.library-filter-min-rating; filter-min-rating: Library.library-filter-min-rating;
filter-unjudged: Library.library-filter-unjudged; filter-unjudged: Library.library-filter-unjudged;
filter-flag: Library.library-filter-flag; filter-flag: Library.library-filter-flag;
@@ -1629,11 +1581,11 @@ in property <bool> panel-visible: true;
Library.library-filter-unjudged-changed(on); Library.library-filter-unjudged-changed(on);
} }
filter-flag-changed(f) => { Library.library-filter-flag-changed(f); } filter-flag-changed(f) => { Library.library-filter-flag-changed(f); }
filter-person-cleared(id) => { root.library-filter-person-cleared(id); } filter-person-cleared(id) => { Library.library-filter-person-cleared(id); }
filter-people-mode-toggled() => { root.library-filter-people-mode-toggled(); } filter-people-mode-toggled() => { Library.library-filter-people-mode-toggled(); }
filter-eyes-open-toggled() => { root.library-filter-eyes-open-toggled(); } filter-eyes-open-toggled() => { Library.library-filter-eyes-open-toggled(); }
people-listed() => { root.library-people-listed(); } people-listed() => { Library.library-people-listed(); }
filter-person-toggled(id) => { root.library-filter-person-toggled(id); } filter-person-toggled(id) => { Library.library-filter-person-toggled(id); }
} }
} }
} }
+48
View File
@@ -646,6 +646,54 @@ export global Library {
callback library-filter-min-rating-changed(int); callback library-filter-min-rating-changed(int);
callback library-filter-unjudged-changed(bool); callback library-filter-unjudged-changed(bool);
callback library-filter-flag-changed(int); callback library-filter-flag-changed(int);
/// Whether the grid is narrowed to the timeline's visible span.
in-out property <bool> library-range-active: false;
callback library-toggle-date-range();
/// TRACES: FR-CAT-6
in property <string> library-range-from;
in property <string> library-range-to;
in property <bool> library-range-invalid: false;
callback library-range-edited(string, string);
/// The same range as a band on the capture-time axis, and the ends of it
/// dragged. Fractions of the span the axis is drawn over — Rust owns the
/// conversion both ways, so the band lands where the finger left it.
in property <float> library-range-from-fraction: -1;
in property <float> library-range-to-fraction: -1;
callback library-timeline-range-changed(float, float);
in property <string> library-root-label: "";
in-out property <[TimelineBar]> library-timeline;
in property <string> library-timeline-label: "";
in property <string> library-window-label: "";
in property <int> library-offset: 0;
in property <int> library-sweep-done: 0;
in property <int> library-sweep-total: 0;
in property <int> library-current-bucket: 0;
in property <float> library-current-fraction: -1;
in property <bool> library-timeline-anchored: false;
callback library-scrub-fraction(float);
callback library-timeline-pinch(float);
callback library-timeline-pan(float);
callback library-timeline-zoom(int);
/// Whose photographs the grid is narrowed to, one entry each.
in property <[PersonChip]> library-filter-people;
/// Whether those people are an intersection rather than a union.
in property <bool> library-filter-people-all: false;
callback library-filter-person-cleared(int);
callback library-filter-people-mode-toggled();
/// TRACES: FR-CULL-8a | FR-CULL-13
/// Whether the grid is narrowed to photographs with nobody blinking.
in property <bool> library-filter-eyes-open: false;
callback library-filter-eyes-open-toggled();
/// Everyone the library knows, for the filter bar's people tray.
/// TRACES: FR-UI-4
/// The gesture reference's rows, read from the generated table.
in property <[GestureRow]> library-gestures;
in property <[PersonChip]> library-people;
callback library-people-listed();
callback library-filter-person-toggled(int);
} }
// The photo roll: the grid's loaded window along the foot of the develop view. // The photo roll: the grid's loaded window along the foot of the develop view.