Keep launcher controls accessible above sheets (#1693)

* fix(ui): keep launcher controls accessible above sheets

* fix(ui): align release cards and anchor platform tooltips

* fix(ui): contain details drawer and close lightbox for dialogs

* fix(ui): fill the release facts row when metadata is missing
This commit is contained in:
Yarila authored and GitHub committed 2026-12-02 00:55:22 +01:00
1 parent 8e3bdb5032
commit 2e8ffbf869
29 files changed
+356 -65

No files matched your search

+1
View File
@@ -16,6 +16,7 @@ next to them.
| `assets/social/x.svg`, `youtube.svg`, `tiktok.svg`, `instagram.svg`, `discord.svg` | X, YouTube, TikTok, Instagram and Discord logos, linking to ArtCraft's accounts | [Simple Icons](https://simpleicons.org/) contributors | Simple Icons, `fill` set to white for tinting; see [`assets/social/README.md`](assets/social/README.md) | CC0 1.0. The logos are trademarks of X Corp., Google LLC, TikTok / ByteDance, Meta Platforms, Inc. and Discord Inc. |
| `assets/social/github.svg`, `assets/social/globe.svg` | GitHub logo (linking to ArtCraft's GitHub) and a globe (linking to ArtCraft's website) | [Simple Icons](https://simpleicons.org/) contributors; [Lucide](https://lucide.dev) contributors | Simple Icons `github.svg` and Lucide `globe.svg` (lucide-static 0.468.0), white for tinting; see [`assets/social/README.md`](assets/social/README.md) | CC0 1.0 (GitHub logo; a trademark of GitHub, Inc.); ISC (globe) |
| `assets/ui-icons/settings.svg`, `assets/ui-icons/bell.svg` | Settings gear and announcements bell in the window header | [Lucide](https://lucide.dev) contributors (portions from Feather, Cole Bemis) | Lucide `settings.svg` and `bell.svg` (lucide-static 0.468.0), white for tinting; see [`assets/ui-icons/README.md`](assets/ui-icons/README.md) | ISC (portions MIT) |
| `assets/ui-icons/apple.svg`, `windows.svg`, `linux.svg`, `freebsd.svg` | Supported platforms in app details | [Simple Icons](https://simpleicons.org/) contributors | Simple Icons 11.10.0, white for tinting; see [`assets/ui-icons/README.md`](assets/ui-icons/README.md) | CC0 1.0. Platform marks belong to their respective owners. |
| `docs/screenshots/artcraft-launcher-grid.png`, `artcraft-launcher-table.png` | Screenshots of ArtCraft Launcher (macOS: grid view in dark theme, table view in light theme), used in the README | ArtCraft Launcher contributors | Captured from the app | MIT OR Apache-2.0 for the screenshot itself; the ArtCraft logo in it stays an ArtCraft trademark ([`docs/brand/LICENSE-brand.txt`](docs/brand/LICENSE-brand.txt)) and the app icons in it keep their own licenses (above) |
| (not bundled) the pictures on each app's details page | Screenshots of the Craft Apps, fetched when a page is opened and kept in the launcher's cache folder | The apps' contributors | [storytold/craft-launcher-assets](https://github.com/storytold/craft-launcher-assets), pinned to a tag (`SCREENSHOTS_REV` in `crates/core/src/details.rs`); each picture's source and license are listed in that repository's `ATTRIBUTION.md` | Each app's own license for the interface (MIT OR Apache-2.0); the work shown in them is public domain or made in the app, as that file says |
| `docs/brand/artcraft-logo.svg`, `artcraft-logo-white.svg` | ArtCraft wordmark, shown in the window header | ArtCraft Team | Supplied brand files, unmodified (same as PhotoCraft's `docs/brand/`) | **Not open source; not MIT or Apache-2.0.** ArtCraft trademark, [`docs/brand/LICENSE-brand.txt`](docs/brand/LICENSE-brand.txt) |
+2
View File
@@ -18,6 +18,8 @@ list (author, source, license) is in ATTRIBUTION.md.
Social service icons (assets/social/*.svg) — Simple Icons, CC0 1.0 (X, YouTube, TikTok, Instagram),
and Font Awesome Free 6.7.2 by Fonticons, Inc., CC BY 4.0 (LinkedIn; https://fontawesome.com/license/free).
The logos are trademarks of their respective owners and are used only to link to ArtCraft's accounts.
Platform icons (assets/ui-icons/apple.svg, windows.svg, linux.svg, freebsd.svg) are from Simple Icons
11.10.0, CC0 1.0. See assets/ui-icons/README.md.
Inter font (assets/fonts/Inter-Variable.ttf) — SIL Open Font License 1.1. See assets/fonts/OFL-Inter.txt.
Archivo font (assets/fonts/Archivo-Variable.ttf) — SIL Open Font License 1.1. See assets/fonts/OFL-Archivo.txt.
Geist Mono font (assets/fonts/GeistMono-Variable.ttf) — SIL Open Font License 1.1. See assets/fonts/OFL-GeistMono.txt.
+5
View File
@@ -7,3 +7,8 @@ the `settings` and `bell` icons from [Lucide](https://lucide.dev) (lucide-static
[ISC](https://github.com/lucide-icons/lucide/blob/main/LICENSE); portions of Lucide come from
Feather (MIT, Cole Bemis). The only changes are `stroke="#ffffff"` instead of `currentColor`, so the
app can tint them to the theme, and the `class` attribute removed.
`apple.svg`, `windows.svg`, `linux.svg` and `freebsd.svg` are from [Simple Icons](https://simpleicons.org/)
11.10.0 (`https://cdn.jsdelivr.net/npm/[email protected]/icons/<name>.svg`), released under
[CC0 1.0](https://github.com/simple-icons/simple-icons/blob/11.10.0/LICENSE.md). The root fill is white
so the launcher can tint the icons. The logos identify the platforms listed in app details.
+1
View File
@@ -0,0 +1 @@
<svg fill="#ffffff" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Apple</title><path d="M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"/></svg>

After

Width:  |  Height:  |  Size: 666 B

+1
View File
@@ -0,0 +1 @@
<svg fill="#ffffff" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>FreeBSD</title><path d="M23.682 2.406c-.001-.149-.097-.187-.24-.189h-.25v.659h.108v-.282h.102l.17.282h.122l-.184-.29c.102-.012.175-.065.172-.18zm-.382.096v-.193h.13c.06-.002.145.011.143.089.005.09-.08.107-.153.103h-.12zM21.851 1.49c1.172 1.171-2.077 6.319-2.626 6.869-.549.548-1.944.044-3.115-1.128-1.172-1.171-1.676-2.566-1.127-3.115.549-.55 5.697-3.798 6.868-2.626zM1.652 6.61C.626 4.818-.544 2.215.276 1.395c.81-.81 3.355.319 5.144 1.334A11.003 11.003 0 0 0 1.652 6.61zm18.95.418a10.584 10.584 0 0 1 1.368 5.218c0 5.874-4.762 10.636-10.637 10.636C5.459 22.882.697 18.12.697 12.246.697 6.371 5.459 1.61 11.333 1.61c1.771 0 3.441.433 4.909 1.199-.361.201-.69.398-.969.574-.428-.077-.778-.017-.998.202-.402.402-.269 1.245.263 2.2.273.539.701 1.124 1.25 1.674.103.104.208.202.315.297 1.519 1.446 3.205 2.111 3.829 1.486.267-.267.297-.728.132-1.287.167-.27.35-.584.538-.927zm2.814-5.088c-.322 0-.584.266-.584.595s.261.595.584.595c.323 0 .584-.266.584-.595s-.261-.595-.584-.595zm0 1.087c-.252 0-.457-.22-.457-.492s.204-.492.457-.492c.252 0 .457.22.457.492s-.204.492-.457.492z"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+1
View File
@@ -0,0 +1 @@
<svg fill="#ffffff" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Linux</title><path d="M12.504 0c-.155 0-.315.008-.48.021-4.226.333-3.105 4.807-3.17 6.298-.076 1.092-.3 1.953-1.05 3.02-.885 1.051-2.127 2.75-2.716 4.521-.278.832-.41 1.684-.287 2.489a.424.424 0 00-.11.135c-.26.268-.45.6-.663.839-.199.199-.485.267-.797.4-.313.136-.658.269-.864.68-.09.189-.136.394-.132.602 0 .199.027.4.055.536.058.399.116.728.04.97-.249.68-.28 1.145-.106 1.484.174.334.535.47.94.601.81.2 1.91.135 2.774.6.926.466 1.866.67 2.616.47.526-.116.97-.464 1.208-.946.587-.003 1.23-.269 2.26-.334.699-.058 1.574.267 2.577.2.025.134.063.198.114.333l.003.003c.391.778 1.113 1.132 1.884 1.071.771-.06 1.592-.536 2.257-1.306.631-.765 1.683-1.084 2.378-1.503.348-.199.629-.469.649-.853.023-.4-.2-.811-.714-1.376v-.097l-.003-.003c-.17-.2-.25-.535-.338-.926-.085-.401-.182-.786-.492-1.046h-.003c-.059-.054-.123-.067-.188-.135a.357.357 0 00-.19-.064c.431-1.278.264-2.55-.173-3.694-.533-1.41-1.465-2.638-2.175-3.483-.796-1.005-1.576-1.957-1.56-3.368.026-2.152.236-6.133-3.544-6.139zm.529 3.405h.013c.213 0 .396.062.584.198.19.135.33.332.438.533.105.259.158.459.166.724 0-.02.006-.04.006-.06v.105a.086.086 0 01-.004-.021l-.004-.024a1.807 1.807 0 01-.15.706.953.953 0 01-.213.335.71.71 0 00-.088-.042c-.104-.045-.198-.064-.284-.133a1.312 1.312 0 00-.22-.066c.05-.06.146-.133.183-.198.053-.128.082-.264.088-.402v-.02a1.21 1.21 0 00-.061-.4c-.045-.134-.101-.2-.183-.333-.084-.066-.167-.132-.267-.132h-.016c-.093 0-.176.03-.262.132a.8.8 0 00-.205.334 1.18 1.18 0 00-.09.4v.019c.002.089.008.179.02.267-.193-.067-.438-.135-.607-.202a1.635 1.635 0 01-.018-.2v-.02a1.772 1.772 0 01.15-.768c.082-.22.232-.406.43-.533a.985.985 0 01.594-.2zm-2.962.059h.036c.142 0 .27.048.399.135.146.129.264.288.344.465.09.199.14.4.153.667v.004c.007.134.006.2-.002.266v.08c-.03.007-.056.018-.083.024-.152.055-.274.135-.393.2.012-.09.013-.18.003-.267v-.015c-.012-.133-.04-.2-.082-.333a.613.613 0 00-.166-.267.248.248 0 00-.183-.064h-.021c-.071.006-.13.04-.186.132a.552.552 0 00-.12.27.944.944 0 00-.023.33v.015c.012.135.037.2.08.334.046.134.098.2.166.268.01.009.02.018.034.024-.07.057-.117.07-.176.136a.304.304 0 01-.131.068 2.62 2.62 0 01-.275-.402 1.772 1.772 0 01-.155-.667 1.759 1.759 0 01.08-.668 1.43 1.43 0 01.283-.535c.128-.133.26-.2.418-.2zm1.37 1.706c.332 0 .733.065 1.216.399.293.2.523.269 1.052.468h.003c.255.136.405.266.478.399v-.131a.571.571 0 01.016.47c-.123.31-.516.643-1.063.842v.002c-.268.135-.501.333-.775.465-.276.135-.588.292-1.012.267a1.139 1.139 0 01-.448-.067 3.566 3.566 0 01-.322-.198c-.195-.135-.363-.332-.612-.465v-.005h-.005c-.4-.246-.616-.512-.686-.71-.07-.268-.005-.47.193-.6.224-.135.38-.271.483-.336.104-.074.143-.102.176-.131h.002v-.003c.169-.202.436-.47.839-.601.139-.036.294-.065.466-.065zm2.8 2.142c.358 1.417 1.196 3.475 1.735 4.473.286.534.855 1.659 1.102 3.024.156-.005.33.018.513.064.646-1.671-.546-3.467-1.089-3.966-.22-.2-.232-.335-.123-.335.59.534 1.365 1.572 1.646 2.757.13.535.16 1.104.021 1.67.067.028.135.06.205.067 1.032.534 1.413.938 1.23 1.537v-.043c-.06-.003-.12 0-.18 0h-.016c.151-.467-.182-.825-1.065-1.224-.915-.4-1.646-.336-1.77.465-.008.043-.013.066-.018.135-.068.023-.139.053-.209.064-.43.268-.662.669-.793 1.187-.13.533-.17 1.156-.205 1.869v.003c-.02.334-.17.838-.319 1.35-1.5 1.072-3.58 1.538-5.348.334a2.645 2.645 0 00-.402-.533 1.45 1.45 0 00-.275-.333c.182 0 .338-.03.465-.067a.615.615 0 00.314-.334c.108-.267 0-.697-.345-1.163-.345-.467-.931-.995-1.788-1.521-.63-.4-.986-.87-1.15-1.396-.165-.534-.143-1.085-.015-1.645.245-1.07.873-2.11 1.274-2.763.107-.065.037.135-.408.974-.396.751-1.14 2.497-.122 3.854a8.123 8.123 0 01.647-2.876c.564-1.278 1.743-3.504 1.836-5.268.048.036.217.135.289.202.218.133.38.333.59.465.21.201.477.335.876.335.039.003.075.006.11.006.412 0 .73-.134.997-.268.29-.134.52-.334.74-.4h.005c.467-.135.835-.402 1.044-.7zm2.185 8.958c.037.6.343 1.245.882 1.377.588.134 1.434-.333 1.791-.765l.211-.01c.315-.007.577.01.847.268l.003.003c.208.199.305.53.391.876.085.4.154.78.409 1.066.486.527.645.906.636 1.14l.003-.007v.018l-.003-.012c-.015.262-.185.396-.498.595-.63.401-1.746.712-2.457 1.57-.618.737-1.37 1.14-2.036 1.191-.664.053-1.237-.2-1.574-.898l-.005-.003c-.21-.4-.12-1.025.056-1.69.176-.668.428-1.344.463-1.897.037-.714.076-1.335.195-1.814.12-.465.308-.797.641-.984l.045-.022zm-10.814.049h.01c.053 0 .105.005.157.014.376.055.706.333 1.023.752l.91 1.664.003.003c.243.533.754 1.064 1.189 1.637.434.598.77 1.131.729 1.57v.006c-.057.744-.48 1.148-1.125 1.294-.645.135-1.52.002-2.395-.464-.968-.536-2.118-.469-2.857-.602-.369-.066-.61-.2-.723-.4-.11-.2-.113-.602.123-1.23v-.004l.002-.003c.117-.334.03-.752-.027-1.118-.055-.401-.083-.71.043-.94.16-.334.396-.4.69-.533.294-.135.64-.202.915-.47h.002v-.002c.256-.268.445-.601.668-.838.19-.201.38-.336.663-.336zm7.159-9.074c-.435.201-.945.535-1.488.535-.542 0-.97-.267-1.28-.466-.154-.134-.28-.268-.373-.335-.164-.134-.144-.333-.074-.333.109.016.129.134.199.2.096.066.215.2.36.333.292.2.68.467 1.167.467.485 0Line truncated

After

Width:  |  Height:  |  Size: 5.4 KiB

+1
View File
@@ -0,0 +1 @@
<svg fill="#ffffff" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Windows</title><path d="M0,0H11.377V11.372H0ZM12.623,0H24V11.372H12.623ZM0,12.623H11.377V24H0Zm12.623,0H24V24H12.623"/></svg>

After

Width:  |  Height:  |  Size: 219 B

+106 -38
View File
@@ -29,6 +29,29 @@ const ARROW: f32 = 36.0;
const SLIDE_SECS: f32 = 0.22;
/// The width of the main button and its menu in the page's top, when the page is wide.
const ACTION_W: f32 = 300.0;
const PLATFORM_ICON_SIZE: f32 = 18.0;
fn platform_icons(ui: &mut Ui, platforms: &str, t: &Tokens) {
ui.scope(|ui| {
ui.spacing_mut().interact_size.y = PLATFORM_ICON_SIZE;
ui.horizontal_wrapped(|ui| {
ui.spacing_mut().item_spacing = vec2(5.0, 3.0);
for name in platforms.split(',').map(str::trim).filter(|name| !name.is_empty()) {
if let Some(icon) = crate::icons::platform(name) {
let image =
egui::Image::new(icon).fit_to_exact_size(vec2(PLATFORM_ICON_SIZE, PLATFORM_ICON_SIZE)).tint(t.ink_strong).alt_text(name);
let response = ui.add(image);
let mut tooltip = egui::Tooltip::for_enabled(&response);
let frame = egui::Frame::popup(ui.style()).corner_radius(CornerRadius::ZERO).fill(t.bg).stroke(t.hairline());
tooltip.popup = tooltip.popup.align(egui::emath::RectAlign::TOP).frame(frame);
tooltip.show(|ui| ui.label(name));
} else {
ui.label(RichText::new(name).size(14.0).color(t.ink_strong));
}
}
});
});
}
/// A details picture, as the backend has sent it.
pub(crate) enum Picture {
@@ -117,14 +140,15 @@ impl LauncherUi {
if self.entry(&id).is_none() {
return;
}
if !open {
// A dialog opened from the launcher header takes over from the enlarged picture.
if !open || self.dialog.is_some() {
self.detail_zoom = false;
}
self.details_keys(ctx, details, open);
let t = Tokens::get(ctx);
// The whole window is the backdrop; the card sits in the middle and rises a little as it fades in.
let area = ctx.content_rect();
// Keep both the page and its hit-blocking backdrop below the launcher header.
let area = crate::sheet::content_rect(ctx);
let width = (area.width() - 64.0).clamp(480.0, 1280.0).min((area.width() - 16.0).max(1.0));
let height = (area.height() - 40.0).clamp(320.0, 1000.0).min((area.height() - 8.0).max(1.0));
let panel = Rect::from_center_size(area.center() + vec2(0.0, (1.0 - k) * 24.0), vec2(width, height));
@@ -149,25 +173,45 @@ impl LauncherUi {
.accessible_name(format!("{}: {}", tl!("App details"), entry.app.name))
.show(ctx, |ui| {
ui.set_opacity(k.clamp(0.0, 1.0));
ui.set_clip_rect(ui.clip_rect().intersect(crate::sheet::content_rect(ctx)));
let painter = ui.painter();
painter.add(theme::shadow(t).as_shape(panel, CornerRadius::ZERO));
painter.rect_filled(panel, CornerRadius::ZERO, t.bg);
painter.rect_stroke(panel, CornerRadius::ZERO, Stroke::new(1.0, t.line_strong), egui::StrokeKind::Inside);
ui.set_min_size(panel.size());
ui.set_max_size(panel.size());
// A bar that stays on screen says there is more below the fold; in the app's colour.
let page_visuals = crate::sheet::accent_scroll(ui, t, t.app_ink(entry.app));
// One scroll position per app, so the next app opens at its top.
egui::ScrollArea::vertical().id_salt(("details-scroll", id.to_string())).auto_shrink([false, false]).show(ui, |ui| {
// The bar's colours are for the bar alone.
*ui.visuals_mut() = page_visuals;
ui.set_width(ui.available_width());
ui.spacing_mut().item_spacing.y = 8.0;
self.details_hero(ui, &entry, details, t, (previous.as_deref(), next.as_deref()), wide);
egui::Frame::new().inner_margin(Margin::same(PAD as i8)).show(ui, |ui| {
self.details_body(ui, &entry, details, wide, t);
});
// Keep the scroll area inside the border, including when its contents request extra width.
let interior = panel.shrink(1.0);
let clip = ui.clip_rect().intersect(interior);
ui.scope_builder(egui::UiBuilder::new().max_rect(interior), |ui| {
ui.set_clip_rect(clip);
// One scroll position per app, so the next app opens at its top.
let page_visuals = crate::sheet::accent_scroll(ui, t, t.app_ink(entry.app));
// Anchor the track to the drawer edge even when a child needs extra width.
// Reserve a gutter so the track never paints over the controls.
let scroll = &mut ui.spacing_mut().scroll;
scroll.floating = true;
scroll.floating_width = scroll.bar_width;
scroll.floating_allocated_width = scroll.bar_width + scroll.bar_inner_margin;
scroll.dormant_handle_opacity = 1.0;
scroll.active_handle_opacity = 1.0;
scroll.dormant_background_opacity = 1.0;
scroll.active_background_opacity = 1.0;
scroll.interact_background_opacity = 1.0;
egui::ScrollArea::vertical()
.id_salt(("details-scroll", id))
.max_width(interior.width())
.max_height(interior.height())
.auto_shrink([false, false])
.show(ui, |ui| {
// The bar's colours are for the bar alone.
*ui.visuals_mut() = page_visuals;
ui.set_width(ui.available_width());
ui.spacing_mut().item_spacing.y = 8.0;
self.details_hero(ui, &entry, details, t, (previous.as_deref(), next.as_deref()), wide);
egui::Frame::new().inner_margin(Margin::same(PAD as i8)).show(ui, |ui| {
self.details_body(ui, &entry, details, wide, t);
});
});
});
});
}
@@ -298,7 +342,7 @@ impl LauncherUi {
/// The page behind the drawer, dimmed (egui can't blur what is under a layer); a click on it closes the drawer.
fn details_scrim(&mut self, ctx: &egui::Context, area: Rect, k: f32, t: &Tokens) {
egui::Area::new(Id::unique("details-scrim")).order(Order::Middle).fixed_pos(area.min).show(ctx, |ui| {
egui::Area::new(Id::unique("details-scrim")).order(Order::Middle).fixed_pos(area.min).constrain(false).show(ctx, |ui| {
let (rect, resp) = ui.allocate_exact_size(area.size(), Sense::click());
ui.painter().rect_filled(rect, CornerRadius::ZERO, theme::scrim(t, k));
if resp.on_hover_cursor(egui::CursorIcon::Default).clicked() {
@@ -409,32 +453,54 @@ impl LauncherUi {
let stems: Vec<&str> = entry.app.stems().collect();
pick_asset(r, &stems, p, p.default_kinds()).map(|(a, _)| widgets::human_bytes(a.size))
});
let facts: Vec<(&str, String)> = [
(tl!("Version"), Some(r.version.as_ref().map_or_else(|| r.tag.clone(), |v| v.to_string()))),
(tl!("Released"), r.published_at.map(date_text)),
(tl!("Download"), size),
(tl!("Platforms"), Some(details.platforms.to_string())),
let version = r.version.as_ref().map_or_else(|| r.tag.clone(), |v| v.to_string());
let released = r.published_at.map(date_text);
let facts = [
(tl!("Version"), Some(version.as_str()), false),
(tl!("Released"), released.as_deref(), false),
(tl!("Download"), size.as_deref(), false),
(tl!("Platforms"), Some(details.platforms), true),
]
.into_iter()
.filter_map(|(label, value)| value.map(|v| (label, v)))
.collect();
.filter_map(|(label, value, platforms)| value.filter(|value| !value.trim().is_empty()).map(|value| (label, value, platforms)))
.collect::<Vec<_>>();
let per_row = per_row.min(facts.len().max(1));
for pair in facts.chunks(per_row) {
ui.columns(per_row, |cols| {
for (col, (label, value)) in cols.iter_mut().zip(pair) {
egui::Frame::new().stroke(t.hairline()).inner_margin(theme::BOX_MARGIN).show(col, |ui| {
ui.set_width(ui.available_width());
ui.spacing_mut().item_spacing.y = 2.0;
widgets::hud(ui, label, t.faint);
ui.add(egui::Label::new(RichText::new(value).size(14.0).color(t.ink_strong)).wrap());
});
}
let boxes = ui.columns(per_row, |cols| {
cols.iter_mut()
.zip(pair)
.map(|(col, (label, value, platforms))| {
egui::Frame::new()
.inner_margin(theme::BOX_MARGIN)
.show(col, |ui| {
ui.set_width(ui.available_width());
ui.set_min_height(32.0);
ui.spacing_mut().item_spacing.y = 2.0;
widgets::hud(ui, label, t.faint);
if *platforms {
platform_icons(ui, value, t);
} else {
ui.add(egui::Label::new(RichText::new(*value).size(14.0).color(t.ink_strong)).wrap());
}
})
.response
.rect
})
.collect::<Vec<_>>()
});
// If a value wraps, extend the other outlines to the same bottom edge.
let bottom = boxes.iter().map(Rect::bottom).fold(f32::NEG_INFINITY, f32::max);
for mut rect in boxes {
rect.max.y = bottom;
ui.painter().rect_stroke(rect, CornerRadius::ZERO, t.hairline(), egui::StrokeKind::Inside);
}
}
ui.add_space(8.0);
crate::notes::show(ui, &r.notes);
ui.add_space(4.0);
widgets::eyebrow(ui, "03", tl!("What's Changed"));
crate::notes::show_in_details(ui, &r.notes);
}
/// The current screenshot, large, over the whole window; ‹ › flip through them, a click or Esc closes it.
/// The current screenshot, large, below the header; ‹ › flip through them, a click or Esc closes it.
fn lightbox(&mut self, ctx: &egui::Context, details: &AppDetails, t: &Tokens) {
let count = details.shots.len();
let at = self.detail_shot.min(count.saturating_sub(1));
@@ -444,13 +510,15 @@ impl LauncherUi {
};
let src = self.picture_source(details.id, shot.key);
let failed = self.failure(details.id, shot.key);
let full = ctx.content_rect();
let full = crate::sheet::content_rect(ctx);
egui::Area::new(Id::unique("details-lightbox"))
.order(Order::Tooltip)
.fixed_pos(full.min)
.constrain(false)
.role(egui::Role::Dialog)
.accessible_name(format!("{}: {}", tl!("Enlarge picture"), CraftApp::by_id(details.id).map_or("", |app| app.name)))
.show(ctx, |ui| {
ui.set_clip_rect(ui.clip_rect().intersect(full));
let (rect, backdrop) = ui.allocate_exact_size(full.size(), Sense::click());
ui.painter().rect_filled(rect, CornerRadius::ZERO, theme::backdrop());
// As large as the window allows, but no larger than 1400 points: the files are 1200 px wide.
+2 -2
View File
@@ -31,7 +31,7 @@ impl LauncherUi {
// uninstall prompt would open as tall as Settings and never shrink (#88).
// The large dialogs run their header to the card's edges; the small prompts keep a margin.
let large = matches!(dialog, Dialog::Settings | Dialog::Notes(_));
let modal = egui::Modal::new(egui::Id::unique("dialog").with(dialog.key())).frame(if large {
let modal = crate::sheet::modal(egui::Id::unique("dialog").with(dialog.key())).frame(if large {
crate::sheet::frame(&t)
} else {
egui::Frame::new().fill(t.bg).stroke(egui::Stroke::new(1.0, t.line_strong)).shadow(theme::shadow(&t)).inner_margin(theme::PAD as i8)
@@ -75,7 +75,7 @@ impl LauncherUi {
let now = self.backend.now();
let Some(alert) = self.alerts.iter().find(|a| a.current(now) && !self.settings.dismissed_notices.contains(&a.id)).cloned() else { return };
let t = Tokens::get(ctx);
let modal = egui::Modal::new(egui::Id::unique("feed_alert").with(&alert.id)).frame(
let modal = crate::sheet::modal(egui::Id::unique("feed_alert").with(&alert.id)).frame(
egui::Frame::new().fill(t.bg).stroke(egui::Stroke::new(1.0, t.line_strong)).shadow(theme::shadow(&t)).inner_margin(theme::PAD as i8),
);
let mut ok = false;
+1
View File
@@ -258,6 +258,7 @@ filter Installed Instalirano
Close (Esc) Zatvori (Esc)
Features Mogućnosti
Latest release Najnovije izdanje
What's Changed Šta se promijenilo
Version Verzija
Platforms Platforme
Releases Izdanja
1 # Bosnian (bs) catalog for ArtCraft Launcher.
258
259
260
261
262
263
264
+1
View File
@@ -281,6 +281,7 @@ filter Installed Nainstalováno
Close (Esc) Zavřít (Esc)
Features Funkce
Latest release Nejnovější verze
What's Changed Co se změnilo
Version Verze
Platforms Platformy
Releases Vydání
1 # Czech (cs) catalog for ArtCraft Launcher.
281
282
283
284
285
286
287
+1
View File
@@ -378,6 +378,7 @@ filter Installed Installiert
Close (Esc) Schließen (Esc)
Features Funktionen
Latest release Neueste Version
What's Changed Was sich geändert hat
Version Version
Platforms Plattformen
Releases Versionen
Can't render this file because it contains an unexpected character in line 11 and column 16.
+1
View File
@@ -294,6 +294,7 @@ filter Installed Instaladas
Close (Esc) Cerrar (Esc)
Features Funciones
Latest release Última versión
What's Changed Qué ha cambiado
Version Versión
Platforms Plataformas
Releases Versiones
Can't render this file because it contains an unexpected character in line 5 and column 48.
+1
View File
@@ -376,6 +376,7 @@ filter Installed Installées
Close (Esc) Fermer (Esc)
Features Fonctionnalités
Latest release Dernière version
What's Changed Nouveautés
Version Version
Platforms Plateformes
Releases Versions
Can't render this file because it contains an unexpected character in line 5 and column 50.
+1
View File
@@ -305,6 +305,7 @@ filter Installed Telepítve
Close (Esc) Bezárás (Esc)
Features Funkciók
Latest release Legújabb kiadás
What's Changed Változások
Version Verzió
Platforms Platformok
Releases Kiadások
Can't render this file because it contains an unexpected character in line 11 and column 16.
+1
View File
@@ -307,6 +307,7 @@ filter Installed インストール済み
Close (Esc) 閉じる (Esc)
Features 機能
Latest release 最新リリース
What's Changed 変更点
Version バージョン
Platforms 対応プラットフォーム
Releases リリース
Can't render this file because it contains an unexpected character in line 14 and column 44.
+1
View File
@@ -308,6 +308,7 @@ filter Installed დაინსტალირებული
Close (Esc) დახურვა (Esc)
Features შესაძლებლობები
Latest release უახლესი გამოშვება
What's Changed რა შეიცვალა
Version ვერსია
Platforms პლატფორმები
Releases გამოშვებები
Can't render this file because it contains an unexpected character in line 13 and column 18.
+1
View File
@@ -306,6 +306,7 @@ filter Installed Zainstalowane
Close (Esc) Zamknij (Esc)
Features Funkcje
Latest release Najnowsze wydanie
What's Changed Co się zmieniło
Version Wersja
Platforms Platformy
Releases Wydania
Can't render this file because it contains an unexpected character in line 11 and column 15.
+1
View File
@@ -366,6 +366,7 @@ filter Installed Instalados
Close (Esc) Fechar (Esc)
Features Recursos
Latest release Último lançamento
What's Changed O que mudou
Version Versão
Platforms Plataformas
Releases Lançamentos
Can't render this file because it contains an unexpected character in line 288 and column 66.
+1
View File
@@ -374,6 +374,7 @@ filter Installed Установлены
Close (Esc) Закрыть (Esc)
Features Возможности
Latest release Последний релиз
What's Changed Что изменилось
Version Версия
Platforms Платформы
Releases Релизы
Can't render this file because it contains an unexpected character in line 13 and column 44.
+1
View File
@@ -371,6 +371,7 @@ filter Installed Встановлені
Close (Esc) Закрити (Esc)
Features Можливості
Latest release Останній випуск
What's Changed Що змінилося
Version Версія
Platforms Платформи
Releases Випуски
Can't render this file because it contains an unexpected character in line 13 and column 44.
+1
View File
@@ -332,6 +332,7 @@ figcraft Interface design and prototyping 界面设计与原型制作
Close (Esc) 关闭(Esc)
Features 功能特性
Latest release 最新发布
What's Changed 更新内容
Version 版本
Platforms 平台
Releases 版本发布
Can't render this file because it contains an unexpected character in line 4 and column 3.
+1
View File
@@ -330,6 +330,7 @@ figcraft Interface design and prototyping 介面設計與原型製作
Close (Esc) 關閉(Esc)
Features 功能
Latest release 最新發行版
What's Changed 更新內容
Version 版本
Platforms 平台
Releases 發行版本
Can't render this file because it contains an unexpected character in line 4 and column 3.
+11
View File
@@ -87,6 +87,17 @@ pub fn bell() -> ImageSource<'static> {
egui::include_image!("../../../assets/ui-icons/bell.svg")
}
pub(crate) fn platform(name: &str) -> Option<ImageSource<'static>> {
Some(match name {
"macOS" => egui::include_image!("../../../assets/ui-icons/apple.svg"),
"Windows" => egui::include_image!("../../../assets/ui-icons/windows.svg"),
"Linux" => egui::include_image!("../../../assets/ui-icons/linux.svg"),
"FreeBSD" => egui::include_image!("../../../assets/ui-icons/freebsd.svg"),
name if name.eq_ignore_ascii_case("web") => social("Website")?,
_ => return None,
})
}
/// The ArtCraft "A" mark in blue, as supplied: the launcher's app icon and getartcraft.com's favicon.
pub fn artcraft_mark() -> ImageSource<'static> {
egui::include_image!("../../../docs/brand/artcraft-mark.svg")
+2 -2
View File
@@ -1046,7 +1046,7 @@ impl LauncherUi {
if let Some(id) = self.nightly.uninstall.clone() {
let mut remove = false;
let mut cancel = false;
let response = egui::Modal::new(egui::Id::unique("nightly-uninstall-v1")).frame(frame).show(ctx, |ui| {
let response = crate::sheet::modal(egui::Id::unique("nightly-uninstall-v1")).frame(frame).show(ctx, |ui| {
ui.set_width(440.0_f32.min(ctx.content_rect().width() - 80.0).max(100.0));
ui.label(crate::widgets::heading(tl!("Uninstall developer build?"), crate::theme::DIALOG_TITLE, tokens.ink_strong));
ui.add_space(8.0);
@@ -1073,7 +1073,7 @@ impl LauncherUi {
}
let mut enable = false;
let mut cancel = false;
let response = egui::Modal::new(egui::Id::unique("nightly-consent-v1")).frame(frame).show(ctx, |ui| {
let response = crate::sheet::modal(egui::Id::unique("nightly-consent-v1")).frame(frame).show(ctx, |ui| {
ui.set_width(440.0_f32.min(ctx.content_rect().width() - 80.0).max(100.0));
ui.label(crate::widgets::heading(tl!("Enable developer builds?"), crate::theme::DIALOG_TITLE, tokens.ink_strong));
ui.add_space(8.0);
+13 -8
View File
@@ -37,8 +37,11 @@ pub(crate) fn classify(line: &str) -> Line<'_> {
/// How many changes show before the rest folds away.
const SHOWN: usize = 6;
pub(crate) fn show(ui: &mut Ui, notes: &str) {
show_scaled(ui, notes, 1.0);
pub(crate) fn show_in_details(ui: &mut Ui, notes: &str) {
ui.scope(|ui| {
ui.spacing_mut().item_spacing.y = 4.0;
show_lines(ui, notes, 1.0, true);
});
}
/// The notes at `scale` times their usual size (the notes dialog's own zoom).
@@ -47,19 +50,23 @@ pub(crate) fn show_scaled(ui: &mut Ui, notes: &str, scale: f32) {
for font in ui.style_mut().text_styles.values_mut() {
font.size *= scale;
}
show_lines(ui, notes, scale);
show_lines(ui, notes, scale, false);
});
}
/// The notes, short: the first few changes in full, the rest behind "Show N more changes", and the
/// link to the full changelog always in view.
fn show_lines(ui: &mut Ui, notes: &str, scale: f32) {
fn show_lines(ui: &mut Ui, notes: &str, scale: f32, has_section_heading: bool) {
let t = Tokens::get(ui.ctx());
if notes.trim().is_empty() {
ui.label(RichText::new(tl!("No notes were published with this release.")).color(t.muted));
return;
}
let (changelog, lines): (Vec<Line<'_>>, Vec<Line<'_>>) = notes.lines().map(classify).partition(|l| full_changelog(l).is_some());
let (changelog, mut lines): (Vec<Line<'_>>, Vec<Line<'_>>) =
notes.lines().map(classify).filter(|line| *line != Line::Blank).partition(|l| full_changelog(l).is_some());
if has_section_heading && matches!(lines.first(), Some(Line::Heading(title)) if title.eq_ignore_ascii_case("What's Changed")) {
lines.remove(0);
}
let bullets = lines.iter().filter(|l| matches!(l, Line::Bullet(..))).count();
let (head, rest) = lines.split_at(fold_at(&lines).unwrap_or(lines.len()));
for line in head {
@@ -118,9 +125,7 @@ fn draw(ui: &mut Ui, line: &Line<'_>, t: &Tokens, scale: f32) {
Line::Text(text) => {
ui.label(RichText::new(*text).color(t.muted));
}
Line::Blank => {
ui.add_space(2.0);
}
Line::Blank => {}
}
}
+13 -1
View File
@@ -11,9 +11,21 @@ use egui::{Color32, Context, CornerRadius, Frame, ImageSource, Margin, Ui, Vec2,
use crate::theme::{self, Tokens, tint};
use crate::widgets;
/// The launcher header stays available while a sheet or picture is open.
pub(crate) fn content_rect(ctx: &Context) -> egui::Rect {
let mut rect = ctx.content_rect();
rect.min.y = (rect.min.y + crate::views::HEADER_H).min(rect.max.y);
rect
}
/// Center modal content below the header, using egui's modal backdrop and focus behavior.
pub(crate) fn modal(id: egui::Id) -> egui::Modal {
egui::Modal::new(id).area(egui::Modal::default_area(id).anchor(egui::Align2::CENTER_CENTER, vec2(0.0, crate::views::HEADER_H / 2.0)))
}
/// The size of a large dialog: the window less a margin all round, no larger than `max`.
pub(crate) fn size(ctx: &Context, max: Vec2) -> Vec2 {
let screen = ctx.content_rect();
let screen = content_rect(ctx);
vec2((screen.width() - 64.0).clamp(1.0, max.x), (screen.height() - 48.0).clamp(1.0, max.y))
}
+1 -2
View File
@@ -266,8 +266,7 @@ enum WindowButton {
/// Minimize, maximize (or restore) and close, `height` tall, for a right-to-left layout: close
/// ends up at the right. Under a dialog egui ignores the header, so there they are drawn in a
/// layer above the dialog's backdrop, as a system title bar is: the first click on Close closes
/// the window, not the dialog (#853). The details drawer and the lightbox still cover them, since
/// their own controls and the apps' menus can sit in that corner.
/// the window, not the dialog (#853). The details drawer and lightbox start below the header.
pub(crate) fn window_buttons_width() -> f32 {
3.0 * CAPTION_W + 1.0
}
+182 -12
View File
@@ -3487,21 +3487,26 @@ fn the_lifted_caption_buttons_leave_tab_and_the_backdrop_to_the_dialog() {
assert!(h.query_by_label("Done").is_none(), "a click left of Minimize dismisses the dialog");
}
/// The details drawer covers the header, and the window's Close stays under it.
/// The details drawer stays below the caption buttons, including while the page is open.
#[test]
fn the_details_drawer_keeps_the_caption_buttons_under_it() {
fn the_details_drawer_keeps_the_caption_buttons_accessible() {
let (mut h, _) = harness_with_title_bar(events(), ViewMode::Grid, egui::Theme::Dark, true, 1.0, artcraft_launcher_ui_egui::TitleBar::Custom);
h.run_steps(8);
let close = h.get_by_label("Close").rect().center();
h.get_by_label("PhotoCraft details").click();
h.run_steps(10);
let asked = click_at(&mut h, close);
assert!(!asked.contains(&egui::ViewportCommand::Close), "the click reached the window's Close: {asked:?}");
for (label, command) in [
("Minimize", egui::ViewportCommand::Minimized(true)),
("Maximize", egui::ViewportCommand::Maximized(true)),
("Close", egui::ViewportCommand::Close),
] {
let spot = h.get_by_label(label).rect().center();
let asked = click_at(&mut h, spot);
assert!(asked.contains(&command), "{label} did not reach the launcher window: {asked:?}");
h.get_by_label("Enlarge picture");
}
}
/// The enlarged picture's own Close sits under the custom title bar's Close. With no dialog open
/// the caption buttons stay in the header, under the picture, so that click closes the picture
/// and not the window.
/// The picture has its own close button below the window's Close.
#[test]
fn the_enlarged_pictures_close_closes_the_picture_not_the_window() {
let (mut h, _) = harness_with_title_bar(events(), ViewMode::Grid, egui::Theme::Dark, true, 1.0, artcraft_launcher_ui_egui::TitleBar::Custom);
@@ -3510,14 +3515,42 @@ fn the_enlarged_pictures_close_closes_the_picture_not_the_window() {
h.run_steps(10);
h.get_by_label("Enlarge picture").click();
h.run_steps(4);
// The drawer's Close is lower down; the picture's is at the top right, under the title bar.
let picture = h.query_all_by_label("Close (Esc)").map(|n| n.rect()).min_by(|a, b| a.top().total_cmp(&b.top())).unwrap();
let spot = picture.intersect(h.get_by_label("Close").rect());
assert!(spot.is_positive(), "the two buttons don't overlap: {picture:?}");
let asked = click_at(&mut h, spot.center());
let window = h.get_by_label("Close").rect();
assert!(picture.top() >= window.bottom(), "the picture's close overlaps the caption: {picture:?}");
let asked = click_at(&mut h, window.center());
assert!(asked.contains(&egui::ViewportCommand::Close), "the title bar did not receive Close: {asked:?}");
let asked = click_at(&mut h, picture.center());
assert!(!asked.contains(&egui::ViewportCommand::Close), "the click reached the window's Close: {asked:?}");
h.run_steps(4);
assert_eq!(h.query_all_by_label("Close (Esc)").count(), 1, "the enlarged picture is still open");
assert!(h.query_by_label("Enlarge picture").is_some(), "the drawer remains open after closing the enlarged picture");
}
#[test]
fn settings_opens_over_the_drawer_and_receives_input_after_enlarging_a_picture() {
use egui::accesskit::Role;
let (mut h, _) = harness_with_title_bar(events(), ViewMode::Grid, egui::Theme::Dark, true, 1.0, artcraft_launcher_ui_egui::TitleBar::Custom);
h.run_steps(8);
h.get_by_label("PhotoCraft details").click();
h.run_steps(10);
h.get_by_label("Enlarge picture").click();
h.run_steps(4);
assert_eq!(h.query_all_by_label("Close (Esc)").count(), 2, "the enlarged picture is open");
let settings = h.get_by_label("Settings").rect().center();
click_at(&mut h, settings);
assert_eq!(h.query_all_by_label("Close (Esc)").count(), 1, "the enlarged picture closes when Settings opens");
h.key_press(egui::Key::Tab);
h.run_steps(2);
let language = h.get_by_role_and_label(Role::ComboBox, "Language");
assert!(language.accesskit_node().is_focused(), "Tab focuses the Language control inside Settings");
let done = h.get_by_label("Done").rect().center();
click_at(&mut h, done);
assert!(h.query_by_label("Done").is_none(), "the mouse can activate a control inside Settings");
h.get_by_label("Enlarge picture");
}
/// Maximized, the window's top-right pixel is the screen's corner: there is no resize band there,
@@ -3734,6 +3767,8 @@ fn clicking_a_card_opens_its_details_drawer() {
h.get_by_label("Website ↗");
h.get_by_label("GitHub ↗");
h.get_by_label("Releases ↗");
assert_eq!(h.query_all_by_label("What's Changed").count(), 1, "the release heading is shown once");
h.get_by_role_and_label(egui::accesskit::Role::Image, "Windows");
// The picture arrows wrap around, and the thumbnails jump.
h.get_by_label("Previous picture (←)").click();
h.run_steps(3);
@@ -3758,6 +3793,60 @@ fn details_drawer_in_the_light_theme() {
h.get_all_by_label_contains("The image editor you already know how to use").last().unwrap();
}
#[test]
fn the_details_header_and_scrollbar_stay_inside_the_drawer_after_resize() {
let (mut h, _) = harness(ViewMode::Grid, egui::Theme::Dark, true);
h.run_steps(8);
h.get_by_label("PhotoCraft details").click();
for width in [1180.0, 720.0, 1000.0] {
h.set_size(egui::vec2(width, 650.0));
h.run_steps(12);
let close = h.get_by_label("Close (Esc)").rect();
let frame = h
.output()
.shapes
.iter()
.find_map(|clipped| match &clipped.shape {
egui::Shape::Rect(shape) if !shape.stroke.is_empty() && shape.rect.contains_rect(close) && shape.rect.height() > 400.0 => {
Some(shape.rect)
}
_ => None,
})
.expect("the drawer has a frame");
let photo = artcraft_launcher_core::CraftApp::by_id("photocraft").unwrap();
let accent = artcraft_launcher_ui_egui::theme::rgb(photo.color);
let stripe = h
.output()
.shapes
.iter()
.find_map(|clipped| match &clipped.shape {
egui::Shape::Rect(shape) if shape.fill == accent && shape.rect.height() <= 2.0 && shape.rect.top() >= frame.top() => {
Some(shape.rect.intersect(clipped.clip_rect))
}
_ => None,
})
.expect("the drawer has an accent stripe");
assert!(frame.contains_rect(stripe), "the stripe crosses the drawer frame at width {width}: {stripe:?} vs {frame:?}");
let scrollbar = h
.query_all_by_role(egui::accesskit::Role::ScrollBar)
.map(|node| node.rect())
.filter(|rect| rect.left() > close.right())
.min_by(|a, b| a.top().total_cmp(&b.top()))
.expect("the details pane has a visible scrollbar");
assert!(frame.contains_rect(scrollbar), "the scrollbar crosses the drawer frame at width {width}: {scrollbar:?} vs {frame:?}");
assert!(
h.output().shapes.iter().any(|clipped| match &clipped.shape {
egui::Shape::Rect(shape) => shape.rect.intersect(clipped.clip_rect) == scrollbar && shape.fill != egui::Color32::TRANSPARENT,
_ => false,
}),
"the scrollbar track is painted at width {width}"
);
}
h.check_accessibility();
snapshot(&mut h, "details-bounded-dark");
}
fn fetches(sent: &Rc<RefCell<Vec<Command>>>, app: &str) -> usize {
sent.borrow().iter().filter(|c| matches!(c, Command::FetchScreenshots { app: a } if a == app)).count()
}
@@ -3877,6 +3966,87 @@ fn a_page_without_pictures_has_no_gallery() {
assert!(h.query_by_label("Next picture (→)").is_none());
}
#[test]
fn release_fact_cards_align_and_platform_names_appear_above_icons() {
use egui::{Shape, accesskit::Role};
let (mut h, _) = harness(ViewMode::Grid, egui::Theme::Dark, true);
h.run_steps(8);
h.get_by_label("PdfCraft details").scroll_to_me();
h.run_steps(3);
h.get_by_label("PdfCraft details").click();
h.run_steps(10);
let card_for = |label| {
let label = h.get_by_label(label).rect();
h.output()
.shapes
.iter()
.filter_map(|shape| match &shape.shape {
Shape::Rect(shape) if !shape.stroke.is_empty() && shape.rect.contains_rect(label) => Some(shape.rect),
_ => None,
})
.min_by(|a, b| a.area().total_cmp(&b.area()))
.expect("the fact has an outline")
};
let download = card_for("Download");
let platforms = card_for("Platforms");
assert!(!download.intersects(platforms), "each fact has its own card");
assert!((download.width() - platforms.width()).abs() < 1.0, "the two cards use equal column widths");
assert!((download.bottom() - platforms.bottom()).abs() < 1.0, "the two cards align at the bottom");
let icon = h.get_by_role_and_label(Role::Image, "Windows").rect();
h.hover_at(icon.center());
h.run_steps(40);
let tooltip = h.get_by_role_and_label(Role::Label, "Windows").rect();
assert!(tooltip.bottom() < icon.top(), "the platform name appears above the icon");
h.check_accessibility();
snapshot(&mut h, "release-platform-tooltip-dark");
}
#[test]
fn release_fact_cards_fill_the_row_even_without_a_release_date() {
let mut events = events();
for event in &mut events {
if let Event::Latest { app, latest: LatestRelease::Found(release), .. } = event
&& app == "photocraft"
{
release.published_at = None;
}
}
let (mut h, _) = harness_with(events, ViewMode::Grid, egui::Theme::Dark, true, 1.0);
h.run_steps(8);
h.get_by_label("PhotoCraft details").click();
h.run_steps(10);
h.get_by_label("Latest release").scroll_to_me();
h.run_steps(5);
h.check_accessibility();
snapshot(&mut h, "release-without-date");
assert!(h.query_by_label("Released").is_none());
let card_for = |label| {
let label = h.get_by_label(label).rect();
h.output()
.shapes
.iter()
.filter_map(|clipped| match &clipped.shape {
egui::Shape::Rect(shape) if !shape.stroke.is_empty() && shape.rect.contains_rect(label) => Some(shape.rect),
_ => None,
})
.min_by(|a, b| a.area().total_cmp(&b.area()))
.expect("the fact has an outline")
};
let [version, download, platforms] = ["Version", "Download", "Platforms"].map(card_for);
assert!(version.right() < download.left() && download.right() < platforms.left());
for card in [version, download] {
assert!((card.width() - platforms.width()).abs() < 1.0);
assert!((card.bottom() - platforms.bottom()).abs() < 1.0);
}
let download_gap = download.left() - version.right();
let last_feature = card_for("Serious color");
assert!((platforms.right() - last_feature.right()).abs() < download_gap, "the release facts should fill the drawer width");
}
#[test]
/// Enlarge adds a second, keyboard-navigable view over the drawer; Esc closes the enlarged
/// picture before the drawer.