mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-04 16:57:00 +01:00
feat(app,android,ios): a blurred poster where a title has no wide art
A title with no fanart, banner or backdrop drew its poster cropped to the band's shape across the title page and the library's banner: a blown-up slice of the middle of it, which read as broken. Now the poster is squeezed to 64x36 and blurred once when it is fetched, the cache keeps that wash, and it is stretched across the band. The library's banner stands the sharp poster at its right over it. Android blurs the poster it already had (Android 12 and later; older versions decode it tiny), and iOS likewise. METADATA.md also records the quality badges of the commit before.
This commit is contained in:
1 parent
f4c08d03c7
commit
3ebfd1a57b
12 files changed
+182
-19
No files matched your search
@@ -230,6 +230,34 @@ fn hero(ui: &mut egui::Ui, art: &mut Art<'_>, title: &Title, actions: &mut Vec<A
|
||||
rect.bottom() - 28.0,
|
||||
),
|
||||
);
|
||||
|
||||
// With no wide art the banner is the poster's wash, so the poster itself
|
||||
// stands at the right, where wide art keeps its subject — over the veils,
|
||||
// and only where it clears the text.
|
||||
if !art.has_wide_art(title)
|
||||
&& let Some((poster, pstr_core::metadata::ArtShape::Portrait)) = art.poster(title)
|
||||
{
|
||||
const INSET: f32 = 28.0;
|
||||
let height = rect.height() - 2.0 * INSET;
|
||||
let size = egui::vec2(height * 2.0 / 3.0, height);
|
||||
let at = egui::Rect::from_min_size(
|
||||
egui::pos2(rect.right() - 2.0 * INSET - size.x, rect.top() + INSET),
|
||||
size,
|
||||
);
|
||||
if at.left() > inner.right() + INSET {
|
||||
painter.add(
|
||||
egui::epaint::RectShape::filled(
|
||||
at,
|
||||
egui::CornerRadius::same(theme::radius::MD),
|
||||
egui::Color32::WHITE.gamma_multiply(art_in),
|
||||
)
|
||||
.with_texture(
|
||||
poster.id(),
|
||||
egui::Rect::from_min_max(egui::Pos2::ZERO, egui::pos2(1.0, 1.0)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
ui.scope_builder(
|
||||
egui::UiBuilder::new()
|
||||
.max_rect(inner)
|
||||
|
||||
Reference in new issue
Block a user