chore(release): v0.1.5 - Linux ksni tray, 1:1 sidebar collapse button, zero-overhead Linux RAM tuning
This commit is contained in:
parent
f063382410
commit
ee65d23b2a
9 changed files with 684 additions and 48 deletions
|
|
@ -3812,7 +3812,7 @@ impl SplashPlayer {
|
|||
/// Spawns a bounded 4-frame background WebP decoder selecting `splash_dark.webp` on `#000`
|
||||
/// or `splash_light.webp` on `#FFF` to match official Yandex Music 5.129.0 SplashScreen 1-to-1!
|
||||
pub fn spawn(is_dark: bool) -> Self {
|
||||
let (tx, rx) = crossbeam_channel::bounded::<SplashFrame>(4);
|
||||
let (tx, rx) = crossbeam_channel::bounded::<SplashFrame>(1);
|
||||
std::thread::Builder::new()
|
||||
.name("ym-splash-decode".into())
|
||||
.spawn(move || {
|
||||
|
|
|
|||
|
|
@ -80,42 +80,58 @@ pub fn render_sidebar(
|
|||
}
|
||||
}
|
||||
|
||||
// Collapse button on hover (`.NavbarDesktop_collapseButton`: 16×28px pill, 6px radius)
|
||||
let sidebar_hovered = ctx.is_hovered(sidebar_rect);
|
||||
if sidebar_hovered {
|
||||
let col_btn_rect = Rect::from_center_size(
|
||||
Pos2::new(sidebar_rect.right() - 8.0, sidebar_rect.top() + 22.0),
|
||||
Vec2::new(16.0, 28.0),
|
||||
);
|
||||
let col_resp = ctx.interact(WidgetId::new("sb_collapse"), col_btn_rect);
|
||||
ctx.dl().push_rect(
|
||||
col_btn_rect,
|
||||
6.0,
|
||||
if col_resp.hovered {
|
||||
// Exact 5.129.0 `.NavbarDesktop_collapseButton__XQh9d` (`f43a2cc01fed8ead.css:157-198`):
|
||||
// - 16×28px pill (`width: 1rem`, `border-radius: 6px`), `margin-inline-end: -8px` overhanging
|
||||
// right onto the sidebar/content seam on `ZLayer::Drawer` (`z-index: header`) so the content
|
||||
// card never clips its right half!
|
||||
// - Smooth 0.20s opacity fade on sidebar OR button hover; 16×16 `xxs` chevron inside;
|
||||
// tooltip ("Развернуть"/"Expand") shown ONLY when collapsed (`enabled: s`).
|
||||
let col_btn_rect = Rect::from_center_size(
|
||||
Pos2::new(sidebar_rect.right(), sidebar_rect.top() + 20.0),
|
||||
Vec2::new(16.0, 28.0),
|
||||
);
|
||||
let show_col_target =
|
||||
!app.fullscreen_open && (ctx.is_hovered(sidebar_rect) || ctx.is_hovered(col_btn_rect));
|
||||
let col_vis = ctx.animate_bool(WidgetId::new("sb_col_vis"), show_col_target, 0.20);
|
||||
if col_vis > 0.01 {
|
||||
ctx.with_layer(ZLayer::Drawer, |ctx| {
|
||||
let col_resp = ctx.interact(WidgetId::new("sb_collapse"), col_btn_rect);
|
||||
let bg_col = if col_resp.hovered {
|
||||
pal.surface_hover
|
||||
} else {
|
||||
pal.surface_secondary
|
||||
},
|
||||
);
|
||||
ctx.draw_icon(
|
||||
if collapsed {
|
||||
Icon::ArrowRightXxs
|
||||
} else {
|
||||
Icon::ArrowLeftXxs
|
||||
},
|
||||
Rect::from_center_size(col_btn_rect.center(), Vec2::splat(20.0)),
|
||||
if col_resp.hovered {
|
||||
}
|
||||
.scale_alpha(col_vis);
|
||||
let icon_col = if col_resp.hovered {
|
||||
pal.text_primary
|
||||
} else {
|
||||
pal.text_secondary
|
||||
},
|
||||
);
|
||||
if col_resp.hovered {
|
||||
ctx.set_cursor(CursorKind::Pointer);
|
||||
}
|
||||
if col_resp.clicked {
|
||||
actions.push(AppAction::ToggleSidebarCollapse);
|
||||
}
|
||||
Color::rgb(0x80, 0x80, 0x80)
|
||||
}
|
||||
.scale_alpha(col_vis);
|
||||
|
||||
ctx.dl().push_rect(col_btn_rect, 6.0, bg_col);
|
||||
ctx.draw_icon(
|
||||
if collapsed {
|
||||
Icon::ArrowRightXxs
|
||||
} else {
|
||||
Icon::ArrowLeftXxs
|
||||
},
|
||||
Rect::from_center_size(col_btn_rect.center(), Vec2::splat(16.0)),
|
||||
icon_col,
|
||||
);
|
||||
if col_resp.hovered {
|
||||
ctx.set_cursor(CursorKind::Pointer);
|
||||
if collapsed {
|
||||
ctx.show_tooltip(
|
||||
col_btn_rect,
|
||||
if ru { "Развернуть" } else { "Expand" },
|
||||
);
|
||||
}
|
||||
}
|
||||
if col_resp.clicked {
|
||||
actions.push(AppAction::ToggleSidebarCollapse);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 2. Navigation Items (exact 5.129.0 order + optional Kids section)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue