Side pills: swap and the eGPU in the system monitor (out of the control centre), coloured temperatures with icons, model switch, mute/block apps, cards close into their anchored pills; home: big calendar with event editing, birthdays, holidays, weather photos, no sign-in form

This commit is contained in:
server2
2026-10-15 23:25:54 +02:00
parent e8741b1cb3
commit d59a5bc81c
12 changed files with 2935 additions and 546 deletions
+28 -6
View File
@@ -61,7 +61,7 @@ impl Pod {
// whether its card takes typing: then it has the keyboard and stays open when the pointer leaves
fn types(self) -> bool {
self == Self::Ai || (self == Self::Home && home::signing_in())
self == Self::Ai || (self == Self::Home && home::typing())
}
fn word(self) -> &'static str {
@@ -225,9 +225,15 @@ fn side(monitor: &Monitor, left: bool) -> LayerWindow {
let (card_w, card_h) = card.map_or((0.0, 0.0), |(pod, _)| pod.size());
// room for the pills to move away from the open island, or for the card
/*
* room for the pills to move away from the open island, or for this side's widest
* card. the width never follows the open card: a narrower window would move with
* its margin, and Hyprland applies size and position on different frames, so the
* pills jumped when a card closed
*/
let room = (island_card::width() - island_pill::width()) / 2.0;
let inner_w = (group_w + room).max(card_w);
let widest = pods.iter().map(|pod| pod.size().0).fold(0.0, f32::max);
let inner_w = (group_w + room).max(widest);
let window_h = top + h.max(card_h) + shadow;
// the group's edge nearest the island, in the window, and where the window starts on the monitor
@@ -261,19 +267,35 @@ fn side(monitor: &Monitor, left: bool) -> LayerWindow {
let (grow, pill_shown, reveal) = card.map_or((0.0, 1.0, 0.0), |(_, t)| phases(t));
/*
* the pills beside an open card are gone; a closing card shrinks back into its own
* pill's place, and they come back behind it only over the last `reveal_at` of its
* shrinking, so they don't pop up around a big card
*/
let reveal_at = layout::reveal_at();
let others = if grow <= 0.0 {
1.0
} else if reveal_at <= 0.0 {
0.0
} else {
let k = (1.0 - grow / reveal_at).clamp(0.0, 1.0);
k * k * (3.0 - 2.0 * k)
};
let mut layers: Vec<Box<dyn Widget>> = Vec::new();
let mut regions: Vec<InputArea> = Vec::new();
for pod in pods {
// the open one becomes the card; the others fade while it grows over them
if card.is_some_and(|(open, _)| open == pod) || grow >= 1.0 {
// the open one is the card, drawn last, over the others
if card.is_some_and(|(open, _)| open == pod) || others <= 0.0 {
continue;
}
let x = pill_x(pod);
let lit = state.hover.get(&pod).map_or(0.0, Animation::value);
let pill = pill(pod, lit, &colors, here);
let pill = if grow > 0.0 { pill.opacity(1.0 - grow) } else { pill };
let pill = if others < 1.0 { pill.opacity(others) } else { pill };
regions.push(InputArea { x: x as i32, y: (top + slide) as i32, width: h.ceil() as i32, height: h.ceil() as i32 });
layers.push(Box::new(pill.translate(x, top + slide)));