Skip to main content

Module marks

Module marks 

Source
Expand description

An image’s marks: a rating (0 to 5 stars), colour labels and a pick or reject flag; the widgets editing them; the culling keys.

The application owns the values: each widget takes the current one and says what the user asked for (MarkResponse::changed); the application applies it to its data (or not), and passes the new value at the next pass.

use egui_pop_views::library::marks::{ColorLabels, FlagToggle, Flag, Labels, RatingStars};

struct Photo { rating: u8, labels: Labels, flag: Flag }

fn ui(ui: &mut egui::Ui, p: &mut Photo) {
    if let Some(r) = RatingStars::new(p.rating).show(ui).changed {
        p.rating = r;
    }
    if let Some(l) = ColorLabels::new(p.labels).show(ui).changed {
        p.labels = l;
    }
    if let Some(f) = FlagToggle::new(p.flag).show(ui).changed {
        p.flag = f;
    }
}

Structs§

ColorLabels
A toggle button per colour label, each drawn in its colour (in the LabelStyle in force). Each button’s tooltip says what it is (“Red label”), with its key when given (ColorLabels::keys: “Red label (6)”), or the application’s own text (ColorLabels::tooltip).
CullKeymap
The keys a focused grid or filmstrip reads for marks, and whether marking moves to the next image (auto-advance).
FlagToggle
Two toggle buttons: pick and reject (a click on the one set unflags). Each button’s tooltip says what it is (“Pick”), with its key when given (FlagToggle::keys: “Pick (P)”), or the application’s own text (FlagToggle::tooltip).
Labels
A set of colour labels.
MarkResponse
What a mark widget returns: its response and the value the user asked for.
Marks
An image’s marks, as the application gives them to the grid.
RatingStars
Five stars: a click on a star gives that rating (on the current one, none); focused, 0 to 5 set it, arrows step it, Home and End go to the ends. A slider for assistive technologies. Under the pointer, the stars up to it preview the value a click gives and the current value stays as a ghost; each star’s tooltip says what a click does.

Enums§

ColorLabel
One of the five colour labels.
CullAction
What a culling key does.
EmptyStars
When empty stars (outlines) show.
Flag
Picked, rejected, or neither.

Constants§

MAX_RATING
The highest rating.