Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ All notable changes to Lilt are documented here. The format follows

## [Unreleased]

## [0.4.8] - 2026-11-17

### Added

- An auto-hide option that tucks the island away above the top edge and reveals it when
the pointer reaches the top centre of the screen, with a smooth slide and fade.

### Changed

- Each appearance keeps its own heading face, chosen to stay legible: Midnight uses Space
Grotesk, Smoked Glass uses Newsreader italic and Liquid Glass uses Unbounded. Settings
section headers use a clean tracked label so the display face is reserved for prominent
titles.

### Fixed

- The settings window no longer resizes or overlaps its content when the Appearance page
opens; it stays wide enough for the appearance cards.

## [0.4.7] - 2026-11-16

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lilt"
version = "0.4.7"
version = "0.4.8"
edition = "2024"
rust-version = "1.88"
description = "A lightweight Dynamic Island-style desktop companion for Windows."
Expand Down
8 changes: 4 additions & 4 deletions THIRD-PARTY-NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ fonts come unmodified from the [Google Fonts repository](https://github.com/goog
(https://github.com/googlefonts/dm-fonts)
- **Space Grotesk**: Copyright 2020 The Space Grotesk Project Authors
(https://github.com/floriankarsten/space-grotesk)
- **Instrument Serif**: Copyright 2022 The Instrument Serif Project Authors
(https://github.com/Instrument/instrument-serif)
- **Allura**: Copyright 2010 The Allura Project Authors
(https://github.com/googlefonts/allura)
- **Newsreader**: Copyright 2020 The Newsreader Project Authors
(https://github.com/productiontype/Newsreader)
- **Unbounded**: Copyright 2022 The Unbounded Project Authors
(https://github.com/googlefonts/unbounded)
- **JetBrains Mono**: Copyright 2020 The JetBrains Mono Project Authors
(https://github.com/JetBrains/JetBrainsMono)

Expand Down
Binary file removed assets/fonts/Allura-Regular.ttf
Binary file not shown.
Binary file removed assets/fonts/InstrumentSerif-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/NewsreaderItalic-Variable.ttf
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2010 The Allura Project Authors (https://github.com/googlefonts/allura)
Copyright 2020 The Newsreader Project Authors (http://github.com/productiontype/Newsreader)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
Expand Down Expand Up @@ -90,4 +90,4 @@ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
OTHER DEALINGS IN THE FONT SOFTWARE.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2022 The Instrument Serif Project Authors (https://github.com/Instrument/instrument-serif)
Copyright 2022 The Unbounded Project Authors (https://github.com/googlefonts/unbounded)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
Expand Down
Binary file added assets/fonts/Unbounded-Variable.ttf
Binary file not shown.
151 changes: 142 additions & 9 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::rc::{Rc, Weak};
use std::time::Duration;

use slint::ComponentHandle;
use windows::Win32::Foundation::{HWND, LPARAM, LRESULT, WPARAM};
use windows::Win32::Foundation::{HWND, LPARAM, LRESULT, POINT, WPARAM};
use windows::Win32::System::Com::{
COINIT_APARTMENTTHREADED, CoInitializeEx, CoInitializeSecurity, EOAC_NONE, RPC_C_AUTHN_LEVEL_DEFAULT,
RPC_C_IMP_LEVEL_IMPERSONATE,
Expand All @@ -27,7 +27,7 @@ use windows::Win32::UI::Shell::{
QUNS_RUNNING_D3D_FULL_SCREEN, SHAppBarMessage, SHQueryUserNotificationState,
};
use windows::Win32::UI::WindowsAndMessaging::{
PBT_APMPOWERSTATUSCHANGE, PBT_APMRESUMEAUTOMATIC, SPI_SETCLIENTAREAANIMATION, SPI_SETDESKWALLPAPER,
GetCursorPos, PBT_APMPOWERSTATUSCHANGE, PBT_APMRESUMEAUTOMATIC, SPI_SETCLIENTAREAANIMATION, SPI_SETDESKWALLPAPER,
SPI_SETWORKAREA, SetForegroundWindow, WM_CLOSE, WM_DISPLAYCHANGE, WM_HOTKEY, WM_POWERBROADCAST, WM_SETTINGCHANGE,
WM_TIMECHANGE,
};
Expand All @@ -47,6 +47,15 @@ use crate::window::{self, Notice, WindowKind, placement};
/// Shell notifications for the app bar registration (full-screen detection).
const WM_APP_APPBAR: u32 = window::WM_APP_USER;

/// Cursor poll interval while the island is tucked away for auto-hide.
const PEEK_POLL: Duration = Duration::from_millis(90);
/// Delay before a revealed island tucks itself away again after the pointer leaves it.
const PEEK_HIDE_DELAY: Duration = Duration::from_millis(600);
/// Logical depth, below the island's top edge, of the band that reveals the island.
const PEEK_BAND_HEIGHT: f32 = 52.0;
/// Logical padding on each side of the compact island within the reveal band.
const PEEK_BAND_PAD: f32 = 40.0;

pub struct App {
island: Island,
tray: Tray,
Expand All @@ -62,6 +71,12 @@ pub struct App {
h24: Cell<bool>,
collapse_timer: slint::Timer,
pointer_inside: Cell<bool>,
/// Auto-hide: whether the island is revealed right now despite being tucked away.
auto_hide_revealed: Cell<bool>,
/// Polls the cursor while the island is tucked, to reveal it at the top centre.
peek_timer: slint::Timer,
/// Re-tucks the island a short while after the pointer leaves it.
peek_hide_timer: slint::Timer,
/// Window that had the focus before the island was expanded, restored on collapse.
previous_foreground: Cell<Option<HWND>>,
media: RefCell<Option<MediaService>>,
Expand Down Expand Up @@ -177,6 +192,9 @@ pub fn run() -> Result<(), slint::PlatformError> {
h24: Cell::new(clock::uses_24_hour_clock()),
collapse_timer: slint::Timer::default(),
pointer_inside: Cell::new(false),
auto_hide_revealed: Cell::new(false),
peek_timer: slint::Timer::default(),
peek_hide_timer: slint::Timer::default(),
previous_foreground: Cell::new(None),
media: RefCell::new(None),
media_state: RefCell::new(None),
Expand Down Expand Up @@ -422,6 +440,11 @@ impl App {
state.set_expanded(expanded);
state.set_activity(false);
app.collapse_timer.stop();
// Expanding reveals an auto-hidden island; collapsing lets it tuck away again.
if expanded {
app.auto_hide_revealed.set(true);
}
App::apply_peek(app);
App::update_progress_timer(app);
App::update_sampling(app);
App::update_glass_sampling(app);
Expand All @@ -439,12 +462,16 @@ impl App {
if !app.pointer_inside.get() {
App::schedule_collapse(app);
}
} else if let Some(previous) = app.previous_foreground.take()
&& native.is_some_and(|n| n.is_foreground())
{
unsafe {
let _ = SetForegroundWindow(previous);
} else {
if let Some(previous) = app.previous_foreground.take()
&& native.is_some_and(|n| n.is_foreground())
{
unsafe {
let _ = SetForegroundWindow(previous);
}
}
// After collapsing, tuck away again once the pointer has left.
App::schedule_peek_hide(app);
}
}

Expand All @@ -453,8 +480,14 @@ impl App {
app.island.global::<AppState>().set_pointer_inside(inside);
if inside {
app.collapse_timer.stop();
} else if app.expanded() {
App::schedule_collapse(app);
// Keep a revealed island out while the pointer rests on it.
app.peek_hide_timer.stop();
} else {
if app.expanded() {
App::schedule_collapse(app);
}
// The pointer left the island: tuck it away again if auto-hide is on.
App::schedule_peek_hide(app);
}
}

Expand Down Expand Up @@ -492,11 +525,111 @@ impl App {
if visible {
app.place();
}
// Under the cursor, auto-hide starts revealed rather than tucking out of reach.
if app.settings.borrow().general.auto_hide && app.pointer_inside.get() {
app.auto_hide_revealed.set(true);
}
App::apply_peek(app);
App::update_progress_timer(app);
App::update_sampling(app);
App::update_glass_sampling(app);
}

/// Re-evaluates whether the island should be tucked away for auto-hide, and starts or
/// stops the cursor poll accordingly.
fn apply_peek(app: &Rc<Self>) {
let governed = app.settings.borrow().general.auto_hide && app.island_visible();
let revealed = !governed || app.expanded() || app.auto_hide_revealed.get();
let tucked = governed && !revealed;
app.island.global::<AppState>().set_tucked(tucked);
if tucked {
if !app.peek_timer.running() {
let weak = Rc::downgrade(app);
app.peek_timer.start(slint::TimerMode::Repeated, PEEK_POLL, move || {
if let Some(app) = weak.upgrade() {
App::peek_tick(&app);
}
});
}
} else {
app.peek_timer.stop();
}
if !governed {
app.peek_hide_timer.stop();
app.auto_hide_revealed.set(false);
}
}

/// Reveals the island when the cursor reaches the band at the top centre.
fn peek_tick(app: &Rc<Self>) {
let Some(zone) = app.peek_trigger_zone() else { return };
let mut point = POINT::default();
if unsafe { GetCursorPos(&mut point) }.is_err() {
return;
}
if zone.contains(point.x, point.y) {
App::reveal_peek(app);
}
}

/// Shows a tucked island and arms a fallback that re-tucks it if the pointer never
/// lands on it.
fn reveal_peek(app: &Rc<Self>) {
if app.auto_hide_revealed.replace(true) {
return;
}
app.peek_hide_timer.stop();
App::apply_peek(app);
App::schedule_peek_hide(app);
}

/// Tucks the island away again and resumes polling the cursor.
fn tuck_peek(app: &Rc<Self>) {
app.auto_hide_revealed.set(false);
App::apply_peek(app);
}

/// Re-tucks the island a short while after the pointer leaves it, unless it is
/// expanded or a field inside is being edited.
fn schedule_peek_hide(app: &Rc<Self>) {
if !(app.settings.borrow().general.auto_hide && app.island_visible())
|| app.expanded()
|| app.pointer_inside.get()
|| app.tasks.busy.get()
|| app.clipboard.busy.get()
|| app.controls.busy.get()
{
return;
}
let weak = Rc::downgrade(app);
app.peek_hide_timer.start(slint::TimerMode::SingleShot, PEEK_HIDE_DELAY, move || {
if let Some(app) = weak.upgrade() {
App::tuck_peek(&app);
}
});
}

/// The band, in physical pixels, that reveals a tucked island: the top centre of the
/// chosen monitor, around where the compact island sits.
fn peek_trigger_zone(&self) -> Option<placement::Rect> {
let monitors = placement::monitors();
let settings = self.settings.borrow();
let monitor = placement::choose(&monitors, settings.position.monitor.as_deref())?;
let scale = monitor.scale;
let half_width = (settings.appearance.compact_width as f32 * scale / 2.0).round() as i32;
let pad = (PEEK_BAND_PAD * scale).round() as i32;
let centre =
monitor.work.left + monitor.work.width() / 2 + (settings.position.offset_x as f32 * scale).round() as i32;
let island_top = monitor.work.top + (settings.position.top_margin as f32 * scale).round() as i32;
Some(placement::Rect {
left: centre - half_width - pad,
right: centre + half_width + pad,
// From the very top edge of the screen down past the compact island.
top: monitor.bounds.top,
bottom: island_top + (PEEK_BAND_HEIGHT * scale).round() as i32,
})
}

/// Updates the clock text and schedules the next update for the start of the next
/// minute. Re-arming per minute keeps the clock aligned after sleep or time changes.
fn refresh_clock(app: &Rc<Self>) {
Expand Down
3 changes: 3 additions & 0 deletions src/app/preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ fn to_data(s: &Settings, monitors: &[placement::Monitor]) -> SettingsData {
auto_collapse_seconds: s.general.auto_collapse_seconds as i32,
collapse_on_outside_click: s.general.collapse_on_outside_click,
activity_banners: s.general.activity_banners,
auto_hide: s.general.auto_hide,
compact_width: s.appearance.compact_width as i32,
expanded_width: s.appearance.expanded_width as i32,
motion: motion_index(s.appearance.motion),
Expand Down Expand Up @@ -591,6 +592,7 @@ fn from_data(d: &SettingsData, monitors: &[placement::Monitor], previous: &Setti
s.general.auto_collapse_seconds = d.auto_collapse_seconds.max(0) as u32;
s.general.collapse_on_outside_click = d.collapse_on_outside_click;
s.general.activity_banners = d.activity_banners;
s.general.auto_hide = d.auto_hide;
s.appearance.compact_width = d.compact_width.max(0) as u32;
s.appearance.expanded_width = d.expanded_width.max(0) as u32;
s.appearance.motion = match d.motion {
Expand Down Expand Up @@ -647,6 +649,7 @@ mod tests {
}];
let mut s = Settings::default();
s.position.monitor = Some(r"\\.\DISPLAY2".into());
s.general.auto_hide = true;
s.ambient.intensity = 35;
s.appearance.motion = MotionPreference::Reduced;
s.appearance.theme = AppearanceMode::LiquidGlass;
Expand Down
10 changes: 5 additions & 5 deletions src/fonts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ use std::sync::Arc;

use slint::fontique_011::fontique;

/// DM Sans (interface), Space Grotesk (Midnight headings), Instrument Serif (Smoked
/// Glass headings), Allura (Liquid Glass headings) and JetBrains Mono (code).
/// DM Sans (interface), Space Grotesk (Midnight headings), Newsreader (Smoked Glass
/// headings, italic), Unbounded (Liquid Glass headings) and JetBrains Mono (code).
const FONTS: [&[u8]; 5] = [
include_bytes!("../assets/fonts/DMSans-Variable.ttf"),
include_bytes!("../assets/fonts/SpaceGrotesk-Variable.ttf"),
include_bytes!("../assets/fonts/InstrumentSerif-Regular.ttf"),
include_bytes!("../assets/fonts/Allura-Regular.ttf"),
include_bytes!("../assets/fonts/NewsreaderItalic-Variable.ttf"),
include_bytes!("../assets/fonts/Unbounded-Variable.ttf"),
include_bytes!("../assets/fonts/JetBrainsMono-Variable.ttf"),
];

Expand Down Expand Up @@ -54,6 +54,6 @@ mod tests {
collection.family_name(*family).expect("a family name").to_owned()
})
.collect();
assert_eq!(names, ["DM Sans", "Space Grotesk", "Instrument Serif", "Allura", "JetBrains Mono"]);
assert_eq!(names, ["DM Sans", "Space Grotesk", "Newsreader", "Unbounded", "JetBrains Mono"]);
}
}
11 changes: 10 additions & 1 deletion src/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ pub struct General {
pub collapse_on_outside_click: bool,
/// Briefly show track changes in the compact island.
pub activity_banners: bool,
/// Keep the island tucked away, revealing it only when the pointer reaches the top
/// centre of the screen.
pub auto_hide: bool,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
Expand Down Expand Up @@ -279,7 +282,13 @@ impl Default for Settings {

impl Default for General {
fn default() -> Self {
Self { auto_collapse: true, auto_collapse_seconds: 8, collapse_on_outside_click: true, activity_banners: true }
Self {
auto_collapse: true,
auto_collapse_seconds: 8,
collapse_on_outside_click: true,
activity_banners: true,
auto_hide: false,
}
}
}

Expand Down
12 changes: 12 additions & 0 deletions ui/components/heading.slint
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,15 @@ export component Title inherits Text {
font-size: root.size * Theme.title-scale;
font-weight: Theme.title-weight;
}

// A small, tracked functional label for settings groups and other utilitarian headers.
// It always uses the interface face, so the appearance's expressive display face stays
// reserved for prominent titles and never lands on a list of technical words.
export component SectionLabel inherits Text {
in property <length> size: Theme.font-sm;
font-family: Theme.font;
font-size: root.size;
font-weight: 600;
letter-spacing: 0.8px;
color: Theme.text-secondary;
}
Loading