diff --git a/Cargo.lock b/Cargo.lock index 073a3a4..ee60562 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1060,6 +1060,20 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" +[[package]] +name = "embed-resource" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbfdaacccebec3b28e4866b8973543c7647797db5ada1bdab552e48fe665fbbd" +dependencies = [ + "cc", + "memchr", + "rustc_version", + "toml", + "vswhom", + "winreg", +] + [[package]] name = "endi" version = "1.1.1" @@ -1655,6 +1669,7 @@ checksum = "b40ca9252762c466af32d0b1002e91e4e1bc5398f77455e55474deb466355ff5" name = "halation-app" version = "0.1.0" dependencies = [ + "embed-resource", "halation-core", "i-slint-backend-testing", "rfd", @@ -4928,6 +4943,26 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "vtable" version = "0.5.0" @@ -5754,6 +5789,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.55.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb5a765337c50e9ec252c2069be9bf91c7df47afb103b642ba3a53bf8101be97" +dependencies = [ + "cfg-if", + "windows-sys 0.59.0", +] + [[package]] name = "wit-bindgen" version = "0.57.1" diff --git a/assets/README.md b/assets/README.md index 0c8cdff..c09b897 100644 --- a/assets/README.md +++ b/assets/README.md @@ -1,19 +1,16 @@ -# Asset provenance +# Asset provenance -`halation-mark.png` is the Halation logo (Java, 2026-10-22): a hand-drawn vector stroke, +`halation-mark.png` is the Halation logo (Java, 2026-10-22): a hand-drawn vector stroke (one continuous line: an arch, a dip and a hooked rise), `docs/media/brand/source/halation-mark.svg`, rendered at 512 px by `tools/render-brand.js` (an identity asset, drawn for this project). `halation-app-icon.png` is the window and taskbar icon from the same script: the mark on a flat `#111111` rounded square. The static Home reference image is kept outside the source tree under ignored `.tools/ui-rebuild-native/home-reference/`; it is composition guidance only and is not embedded in the application. `halation-wordmark.svg` is the HALATION wordmark (one path, identity asset): Bodoni Moda (SIL OFL 1.1) at weight 600, -optical size 60, tracked 0.20 em, converted to outlines (Java's choice, 2026-10-22). -`halation-wordmark-glow.png` is the wordmark's halation glow (960 x 428, the wordmark plus 180 px around it), drawn -from the wordmark by `tools/render-wordmark-glow.js` with Java's settings (2026-10-22). +drawn for this project. `halation-wordmark-glow.png` is its soft white bloom, rendered by `tools/render-wordmark-glow.js`. `drop-outline.svg` is the dashed outline of Home's drop zone, drawn for this crate. -`fonts/SchibstedGrotesk.ttf` (variable weight, © The Schibsted-Grotesk Project Authors) is the interface face and -`fonts/Italiana.ttf` (© Santiago Orozco, Reserved Font Name "Italiana", unmodified) the page-title face; both SIL Open -Font License 1.1, from the Google Fonts repository. +`fonts/Inter.ttf` is the Inter typeface (variable weight, Latin subset), SIL Open Font License 1.1, © The Inter +Project Authors (https://github.com/rsms/inter); the original app uses the same typeface. `drape-loop.mp4`, `drape-tint.bin` and `drape-still.jpg` are recordings of the original Halation's Drape background: a seamless two-minute loop of 1800 frames of 320 x 180 at 15 fps stored as lifted luma in H.264, the colour of each diff --git a/assets/halation-app-icon.ico b/assets/halation-app-icon.ico new file mode 100644 index 0000000..448c351 Binary files /dev/null and b/assets/halation-app-icon.ico differ diff --git a/assets/halation-app-icon.png b/assets/halation-app-icon.png index e5742f1..7278be5 100644 Binary files a/assets/halation-app-icon.png and b/assets/halation-app-icon.png differ diff --git a/assets/halation-mark.png b/assets/halation-mark.png index 3c9a534..703e7ba 100644 Binary files a/assets/halation-mark.png and b/assets/halation-mark.png differ diff --git a/crates/halation-app/Cargo.toml b/crates/halation-app/Cargo.toml index 10ce70c..6bfe8a2 100644 --- a/crates/halation-app/Cargo.toml +++ b/crates/halation-app/Cargo.toml @@ -60,6 +60,8 @@ diag-skia-vulkan = ["slint/renderer-skia-vulkan"] [build-dependencies] slint-build = { version = "=1.18.1", default-features = false, features = ["compat-1-18"] } +# The Windows executable's icon and version resources (build.rs); it finds rc.exe in the Windows SDK +embed-resource = "=3.0.11" [dev-dependencies] # Headless UI tests (layout bounds at small window sizes); test builds only, never part of the shipped binary. diff --git a/crates/halation-app/build.rs b/crates/halation-app/build.rs index ec3d7e8..02d8989 100644 --- a/crates/halation-app/build.rs +++ b/crates/halation-app/build.rs @@ -16,6 +16,7 @@ fn main() { } copy_assets(); + embed_windows_icon(); let sha = git_output(&["rev-parse", "--short=12", "HEAD"]) .filter(|sha| !sha.is_empty()) @@ -36,6 +37,34 @@ fn main() { .expect("the Slint UI must compile; fix the reported .slint diagnostics"); } +/// The window and taskbar icon (the mark on #111111, `tools/render-brand.js`) is also a resource of the executable: +/// Explorer and the taskbar read it before the window exists, and it is the icon of a shortcut or a pinned app. +fn embed_windows_icon() { + if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") { + return; + } + let icon = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap_or_default()) + .join("../../assets/halation-app-icon.ico"); + if !icon.is_file() { + println!( + "cargo:warning=assets/halation-app-icon.ico is missing; run node tools/render-brand.js" + ); + return; + } + println!("cargo:rerun-if-changed={}", icon.display()); + let script = PathBuf::from(std::env::var_os("OUT_DIR").unwrap_or_default()).join("halation.rc"); + // Forward slashes: rc.exe reads `\t` in a quoted path as an escape (and this tree lives under `\trrax`) + let source = format!( + "1 ICON \"{}\"\n", + icon.display().to_string().replace('\\', "/") + ); + std::fs::write(&script, source).expect("the icon resource script must be written"); + // Only the app binary carries the icon; test and benchmark executables do not need it. + embed_resource::compile_for(&script, ["halation-slint"], embed_resource::NONE) + .manifest_optional() + .expect("the icon resource must compile (rc.exe comes with the Windows SDK)"); +} + /// Development builds run from `target/`: put a copy of the workspace's `assets/` next to the executable there, /// as the installer does beside the installed one. Only changed files are copied. fn copy_assets() { diff --git a/crates/halation-app/src/app.rs b/crates/halation-app/src/app.rs index 1b94bbe..d9b2a28 100644 --- a/crates/halation-app/src/app.rs +++ b/crates/halation-app/src/app.rs @@ -1438,6 +1438,7 @@ fn apply_motion(ui: &AppWindow, tokens: motion::Tokens) { global.set_fade(ms(tokens.fade)); global.set_panel(ms(tokens.panel)); global.set_tip_wait(ms(tokens.tip_wait)); + global.set_dock_light(ms(tokens.dock_light)); global.set_press_scale(tokens.press_scale); } diff --git a/crates/halation-app/src/motion.rs b/crates/halation-app/src/motion.rs index 34341eb..9cd35e0 100644 --- a/crates/halation-app/src/motion.rs +++ b/crates/halation-app/src/motion.rs @@ -24,6 +24,8 @@ pub struct Tokens { pub panel: Duration, /// Hover time before a tooltip shows (a timer, not an animation: it paints nothing while it waits) pub tip_wait: Duration, + /// The dock's pointer light appearing and leaving (the original's 320 ms `--spring`) + pub dock_light: Duration, /// Scale of a pressed control, in percent pub press_scale: f32, } @@ -37,6 +39,7 @@ const NORMAL: Tokens = Tokens { fade: Duration::from_millis(80), panel: Duration::from_millis(120), tip_wait: Duration::from_millis(400), + dock_light: Duration::from_millis(320), press_scale: 97.0, }; @@ -51,6 +54,7 @@ pub fn tokens(reduced_motion: bool) -> Tokens { trail: Duration::ZERO, fade: Duration::ZERO, panel: Duration::ZERO, + dock_light: Duration::ZERO, press_scale: 100.0, ..NORMAL } diff --git a/crates/halation-app/src/screenshot.rs b/crates/halation-app/src/screenshot.rs index d6a5fa8..e1d4f50 100644 --- a/crates/halation-app/src/screenshot.rs +++ b/crates/halation-app/src/screenshot.rs @@ -1,4 +1,4 @@ -//! `--screenshot x `: one headless snapshot of a page, for visual review without +//! `--screenshot x `: one headless snapshot of a page, for visual review without //! opening a window or touching the desktop. Diagnostic builds only (`diag-screenshot`); the shipping build has none //! of this code. It renders with Slint's software renderer into memory, so it approximates the layout of the real //! Skia window (text and edges differ); each run says so. The page is set by property, no input is simulated. @@ -192,10 +192,14 @@ fn profile_tools(out_dir: &Path, page: &str) -> PathBuf { } pub fn run(spec: ScreenshotSpec) -> Result<(), Box> { - // home, home-open (sidebar open), settings, settings-<0..7> (a section) + // home, home-open (sidebar open), settings, settings-<0..7> (a section), home-pointer (a pointer over the strip's + // left half, for the dock's light), home-hover (a pointer at rest over the drop zone) let (page, mode, section) = match spec.page.as_str() { "home" => (0, 0, -1), "home-open" => (0, 2, -1), + "home-pointer" => (0, 0, -2), + // A real pointer over the drop zone's middle: it must stay flat under it + "home-hover" => (0, 6, -1), "settings" => (3, 0, -1), "converter" => (4, 0, -1), "converter-open" => (4, 2, -1), @@ -209,7 +213,7 @@ pub fn run(spec: ScreenshotSpec) -> Result<(), Box> { Some(section) if (0..8).contains(§ion) => (3, 0, section), _ => { return Err(format!( - "unknown page '{other}'; expected home, home-open, settings, settings-<0..7>, converter, converter-open, converter-ready, converter-audio or converter-video" + "unknown page '{other}'; expected home, home-open, home-pointer, home-hover, settings, settings-<0..7>, converter, converter-open, converter-ready, converter-audio or converter-video" ) .into()); } @@ -329,6 +333,25 @@ pub fn run(spec: ScreenshotSpec) -> Result<(), Box> { ui.set_settings_jump(section); pump(&queue, Duration::from_millis(300)); } + if mode == 6 { + // A real pointer resting over the drop zone's middle (the built-in hover pipeline, no glow must answer it) + ui.window() + .dispatch_event(slint::platform::WindowEvent::PointerMoved { + position: slint::LogicalPosition::new(spec.width as f32 * 0.5, 680.0), + }); + pump(&queue, Duration::from_millis(100)); + ui.window() + .dispatch_event(slint::platform::WindowEvent::PointerMoved { + position: slint::LogicalPosition::new(spec.width as f32 * 0.5, 680.0), + }); + pump(&queue, Duration::from_millis(600)); + } + if section == -2 { + // A pointer resting over the tool strip's right half: the dock's light follows it (headless, no mouse to move) + ui.set_home_pointer_on(true); + ui.set_home_pointer_x(spec.width as f32 * 0.6); + pump(&queue, Duration::from_millis(400)); + } let (w, h) = (spec.width as usize, spec.height as usize); let mut buffer = vec![Rgb8Pixel::new(0, 0, 0); w * h]; diff --git a/crates/halation-app/tests/services.rs b/crates/halation-app/tests/services.rs index 4f72391..da63a67 100644 --- a/crates/halation-app/tests/services.rs +++ b/crates/halation-app/tests/services.rs @@ -411,6 +411,8 @@ fn reduced_motion_resolves_deterministically_to_zero_duration() { assert!(normal.hover_in < normal.hover_out, "fast in, soft out"); assert!(normal.glide < normal.trail, "a moving pill stretches"); assert!(normal.press_scale < 100.0); + // The dock's light keeps the original strip's 320 ms reveal (docs/features/motion.md §4.4), longer than the rest + assert_eq!(normal.dock_light, Duration::from_millis(320)); for d in [ reduced.hover_in, reduced.hover_out, @@ -419,6 +421,7 @@ fn reduced_motion_resolves_deterministically_to_zero_duration() { reduced.trail, reduced.fade, reduced.panel, + reduced.dock_light, ] { assert_eq!(d, Duration::ZERO); } diff --git a/crates/halation-app/ui/app.slint b/crates/halation-app/ui/app.slint index 0540c53..698e95e 100644 --- a/crates/halation-app/ui/app.slint +++ b/crates/halation-app/ui/app.slint @@ -77,6 +77,10 @@ export component AppWindow inherits Window { in-out property library-mode: 0; // The sidebar open with labels; closed it shows icons only (planning/active/ui-redesign.md §6) in-out property rail-open: false; + // Home's tool strip: where the pointer is (window x) and whether it is over the strip, for the dock's light + // (headless snapshots set them; in the real window only Home's items report them) + in-out property home-pointer-x: 0px; + in-out property home-pointer-on: false; // Settings category to open at (headless snapshots) in property settings-jump: -1; // Settings category shown (the top bar's search changes it) @@ -214,6 +218,9 @@ export component AppWindow inherits Window { tools: root.active-tools; recent: root.recent; library-loaded: root.library-loaded; + // Two-way: the headless snapshots place the pointer they cannot move (like `settings-jump`) + pointer-x <=> root.home-pointer-x; + pointer-on <=> root.home-pointer-on; tool-activated(id) => { root.tool-activated(id); } choose-reference => { root.choose-reference(); } file-dropped(data) => { root.file-dropped(data); } diff --git a/crates/halation-app/ui/components/dock-light.slint b/crates/halation-app/ui/components/dock-light.slint new file mode 100644 index 0000000..2cfad5e --- /dev/null +++ b/crates/halation-app/ui/components/dock-light.slint @@ -0,0 +1,35 @@ +import { Theme } from "../theme.slint"; +import { Motion, Curve } from "../motion.slint"; + +// The dock's pointer light, from the original Home's tool strip: a soft white band that follows the pointer along the +// dock, plus the same light catching the dock's edge near it. It is a gradient, never a blur or a shadow. `at` is the +// pointer's position along the dock, in this component's coordinates; `on` is true while the pointer is over the dock. +// The light fades by its colours' alpha, not by `opacity` (no layer; docs/features/motion.md §2). +export component DockLight inherits Rectangle { + in property at: root.width / 2; + in property on: false; + in property radius: Theme.radius; + // 90 px, the original's `radial-gradient(90px circle …)` + in property reach: 90px; + // 80 px for the edge ring, as the original's `::after` mask + in property edge-reach: 80px; + property shown: root.on ? 1 : 0; + animate shown { duration: Motion.dock-light; easing: Curve.ease; } + // `--glow-dock: rgba(255,255,255,.08)` and `--glow-dock-edge: rgba(255,255,255,.42)` + property fill: Theme.text.transparentize(1 - 0.08 * root.shown); + property edge: Theme.text.transparentize(1 - 0.42 * root.shown); + + Rectangle { + width: 100%; + height: 100%; + border-radius: root.radius; + background: @radial-gradient(circle root.reach at root.at root.height / 2, root.fill 0%, transparent 72%); + } + Rectangle { + width: 100%; + height: 100%; + border-radius: root.radius; + border-width: 1px; + border-color: @radial-gradient(circle root.edge-reach at root.at root.height / 2, root.edge 0%, transparent 70%); + } +} diff --git a/crates/halation-app/ui/motion.slint b/crates/halation-app/ui/motion.slint index ec9869f..3f94ea7 100644 --- a/crates/halation-app/ui/motion.slint +++ b/crates/halation-app/ui/motion.slint @@ -13,6 +13,8 @@ export global Motion { in-out property panel: 120ms; // A Timer, not an animation delay: a delay repaints every frame while it waits in-out property tip-wait: 400ms; + // The dock's pointer light: the original's `--spring` (320 ms) fade in and out + in-out property dock-light: 320ms; in-out property press-scale: 97%; // Fast in, soft out diff --git a/crates/halation-app/ui/pages/home.slint b/crates/halation-app/ui/pages/home.slint index 9972ca4..1b9b177 100644 --- a/crates/halation-app/ui/pages/home.slint +++ b/crates/halation-app/ui/pages/home.slint @@ -4,6 +4,7 @@ import { ToolIcon } from "../icons.slint"; import { ToolItem, RecentItem } from "../models.slint"; import { Motion, Curve } from "../motion.slint"; import { PillList } from "../components/pills.slint"; +import { DockLight } from "../components/dock-light.slint"; import { Surface, Level } from "../components/surface.slint"; // One entry of Home's tool strip: icon over its name. Its hover is the strip's sliding pill: it reports where it is. @@ -20,6 +21,8 @@ component StripItem inherits FocusScope { in property label; callback activated; callback hovered(bool, length, length); + // The pointer's x in window coordinates and whether it is over this item: the dock's light follows it + callback pointed(length, bool); changed x => { if (touch.has-hover) { root.hovered(true, root.absolute-position.x, root.width); @@ -83,8 +86,14 @@ component StripItem inherits FocusScope { root.focus(); root.activated(); } + moved => { + if (self.has-hover) { + root.pointed(root.absolute-position.x + self.mouse-x, true); + } + } changed has-hover => { root.hovered(self.has-hover, root.absolute-position.x, root.width); + root.pointed(root.absolute-position.x + self.mouse-x, self.has-hover); } } } @@ -104,6 +113,10 @@ export component HomePage inherits Rectangle { // The hero's top edge follows the window's middle; the drop zone keeps 70 px to the bottom property hero-top: max(24px, root.height / 2 - 240px); property drop-top: max(root.hero-top + 222px, root.height - 36px - 72px - 14px - 196px); + // Where the pointer is along the tool strip (window x) and whether it is over it: the strip's light follows it. + // In-out so the headless snapshots can place a pointer they cannot move (like `jump-to` in Settings). + in-out property pointer-x: 0px; + in-out property pointer-on: false; // The wordmark's halation glow (docs/features/material.md), a prepared image: no blur runs on Home Image { @@ -149,6 +162,15 @@ export component HomePage inherits Rectangle { glass: true; radius: Theme.radius; } + // The dock's light follows the pointer along the whole strip, under the tools, as in the original + DockLight { + width: parent.width; + height: parent.height; + radius: Theme.radius; + // Window x turned into the strip's own coordinates; the items' absolute x already carries its padding + at: root.pointer-x - strip.absolute-position.x; + on: root.pointer-on; + } strip-pills := PillList { x: 5px; y: 5px; @@ -171,6 +193,10 @@ export component HomePage inherits Rectangle { label: tool.name; activated => { root.tool-activated(tool.id); } hovered(on, at, size) => { strip-pills.hover(on, at, size); } + pointed(at, on) => { + root.pointer-x = at; + root.pointer-on = on; + } } } } @@ -182,37 +208,20 @@ export component HomePage inherits Rectangle { // Taller and wider, recent files lower (Java, 2026-10-22) width: min(780px, parent.width - 48px); height: 196px; - // A panel over the Drape; under a dragged file or keyboard focus, an accent edge and a faint accent veil + // A flat panel over the Drape, like the other cards: the fill and the line never light up under the pointer. + // Under a dragged file or keyboard focus it keeps an accent edge (state, not decoration). Surface { level: Level.bubble; glass: true; radius: Theme.radius; - veil: drop-area.has-drag ? Theme.accent.transparentize(88%) : drop-touch.has-hover ? Theme.hover-fill.transparentize(40%) : Theme.hover-fill.transparentize(1); - animate veil { duration: Motion.hover(drop-touch.has-hover || drop-area.has-drag); easing: Curve.ease; } - } - // The pointer light of the original Home (Java, 2026-10-22): a soft white circle under the pointer, brighter - // while a file is over the zone. It is a gradient, not a blur: no shadow is rendered, and the light only - // exists while the drop zone is hovered. - Rectangle { - property glow-radius: drop-area.has-drag ? 420px : 160px; - property glow-x: drop-touch.has-hover ? drop-touch.mouse-x : self.width / 2; - property glow-y: drop-touch.has-hover ? drop-touch.mouse-y : self.height / 2; - // The light fades by its own colour alpha, not by `opacity`: an opacity animation makes Skia compose the - // rectangle offscreen on every frame (tests/services.rs enforces the rule). - property glow-centre: drop-touch.has-hover || drop-area.has-drag - ? Theme.text.transparentize(92%) - : Theme.text.transparentize(100%); - animate glow-centre { duration: Motion.hover(drop-touch.has-hover || drop-area.has-drag); easing: Curve.ease; } - border-radius: Theme.radius; - background: @radial-gradient(circle glow-radius at glow-x glow-y, - glow-centre 0%, - Theme.text.transparentize(100%) 72%); + veil: drop-area.has-drag ? Theme.accent.transparentize(88%) : Theme.hover-fill.transparentize(1); + animate veil { duration: Motion.hover(drop-area.has-drag); easing: Curve.ease; } } Rectangle { border-radius: Theme.radius; border-width: 1px; - border-color: drop-area.has-drag || drop-focus.has-focus ? Theme.accent : drop-touch.has-hover ? Theme.line-hover : Theme.accent.transparentize(1); - animate border-color { duration: Motion.hover(drop-touch.has-hover || drop-area.has-drag); easing: Curve.ease; } + border-color: drop-area.has-drag || drop-focus.has-focus ? Theme.accent : Theme.accent.transparentize(1); + animate border-color { duration: Motion.hover(drop-area.has-drag); easing: Curve.ease; } } // Grows a little under a dragged file, sinks a little on press // (nothing scales with reduced motion, when the press scale is 100 %) @@ -224,11 +233,9 @@ export component HomePage inherits Rectangle { Rectangle { x: (parent.width - self.width) / 2; - // The tile rises 2 px under the pointer, as in the original Home - y: drop-touch.has-hover || drop-area.has-drag ? 46px : 48px; + y: 48px; width: 48px; height: 48px; - animate y { duration: Motion.hover(drop-touch.has-hover || drop-area.has-drag); easing: Curve.ease; } Surface { level: Level.raised; radius: Theme.radius; diff --git a/docs/features/motion.md b/docs/features/motion.md index 0b93544..ce2065e 100644 --- a/docs/features/motion.md +++ b/docs/features/motion.md @@ -72,6 +72,7 @@ Rust no puede contener un `easing`; `spring(0)` se escribe en cada sitio porque | `trail` | 110 ms | `spring(0)` | Borde trasero de las píldoras | | `fade` | 80 ms | `ease-out` | Tooltips, etiquetas de la sidebar | | `panel` | 120 ms | `ease-out` | Ancho de la sidebar | +| `dock-light` | 320 ms | `ease-out` | Luz del dock de Home, al entrar y salir | | `tip-wait` | 400 ms | `Timer` | Espera antes de mostrar un tooltip | | `press-scale` | 97 % | — | Escala al pulsar | @@ -95,13 +96,17 @@ Cambian juntos el fondo, el tinte del icono y el color del texto. | `Select`, `Field`, `SearchField` | Borde `line-strong` → `line-strong` aclarado; fondo → `control-hover` | | Opciones de un `Select` abierto | Fondo → `control-active` | | Tarjetas de modo de guardado y celdas de Settings | Fondo → `control-hover` | -| Zona de soltar de Home | Luz radial blanca al 8 % que sigue al puntero (160 px; 420 px al arrastrar), borde a `line-hover` e icono 2 px arriba, con `hover-in`/`hover-out` | +| Zona de soltar de Home | Plana: ni el relleno ni el borde cambian con el puntero (Java, 2026-10-23) | | `Toggle` | Pista un tono más clara | -**Luz de la zona de soltar** (Java, 2026-10-22, aprobada): un degradado radial blanco al 8 % de 160 px sigue al -puntero dentro de la zona; al arrastrar un archivo crece a 420 px, el borde pasa a `line-hover` y el icono sube 2 px. -El centro es un color con alfa animado en `hover-in`/`hover-out` (nunca `opacity`: Skia compondría una capa); se apaga -al salir o al soltar. +**Luz del dock de Home** (Java, 2026-10-23: replicar la luz del dock de la app Tauri; se miró su CSS como +referencia, sin tomar código): una banda blanca suave de 90 px sigue al puntero a lo largo de la barra de +herramientas, con un degradado radial al 8 % que se apaga al 72 % de su radio; el borde de la barra recibe la misma +luz en un anillo de 80 px al 42 %, apagado al 70 %. El centro es un color con alfa animado —nunca `opacity`— y +aparece y se va en `dock-light` (320 ms, `ease-out`), la transición del original. Se apaga al salir de la barra; el +resaltado de la herramienta bajo el puntero sigue siendo la píldora compartida. La zona de soltar de Home ya no +lleva luz: es una tarjeta plana como las demás, y solo el arrastre o el foco de teclado encienden su borde de acento +(estado, no decoración). **Píldora de hover compartida** (sidebar, lista de categorías y barra de herramientas de Home; Java, 2026-10-22: «la píldora del dock se mueve sin que le des clic y se desplaza fluidamente»): un único `Rectangle` sin hijos por lista, diff --git a/docs/media/brand/halation-app-icon.svg b/docs/media/brand/halation-app-icon.svg index 26e664c..ac6ce6c 100644 --- a/docs/media/brand/halation-app-icon.svg +++ b/docs/media/brand/halation-app-icon.svg @@ -1,5 +1,5 @@ - + diff --git a/docs/media/brand/halation-mark-source.png b/docs/media/brand/halation-mark-source.png index 3c9a534..703e7ba 100644 Binary files a/docs/media/brand/halation-mark-source.png and b/docs/media/brand/halation-mark-source.png differ diff --git a/docs/media/brand/halation-mark.svg b/docs/media/brand/halation-mark.svg index 48c7a90..f9cd329 100644 --- a/docs/media/brand/halation-mark.svg +++ b/docs/media/brand/halation-mark.svg @@ -1 +1 @@ - + diff --git a/docs/media/brand/source/halation-mark.svg b/docs/media/brand/source/halation-mark.svg index 48c7a90..f9cd329 100644 --- a/docs/media/brand/source/halation-mark.svg +++ b/docs/media/brand/source/halation-mark.svg @@ -1 +1 @@ - + diff --git a/tools/render-brand.js b/tools/render-brand.js index ee96b4b..9750dff 100644 --- a/tools/render-brand.js +++ b/tools/render-brand.js @@ -5,6 +5,8 @@ // - assets/halation-mark.png (512 px): the transparent mark. // - assets/halation-app-icon.png (256 px): the window and taskbar icon, the mark at 62% on a flat #111111 rounded // square (the interface's surface grey) with an 8% white hairline. +// - assets/halation-app-icon.ico: the same icon at 16, 24, 32, 48 and 256 px, embedded in the Windows executable +// (crates/halation-app/build.rs) and used for the window and taskbar. // - docs/media/brand/: halation-mark.svg (the source), halation-app-icon.svg, halation-mark-source.png (the mark PNG). // // Usage: node tools/render-brand.js (CHROME and NODE_PATH as needed for Playwright) @@ -14,6 +16,7 @@ const { chromium } = require("playwright"); const MARK_PNG = 512; const ICON_PNG = 256; +const ICO_SIZES = [16, 24, 32, 48, 256]; // Share of the square the mark spans const SPAN = 0.62; @@ -37,7 +40,7 @@ function iconSvg() { } async function rasterize(page, svg, size) { - const base64 = await page.evaluate( + const { png, rgba } = await page.evaluate( async ({ svg, size }) => { const image = new Image(); image.src = "data:image/svg+xml;base64," + btoa(svg); @@ -47,11 +50,62 @@ async function rasterize(page, svg, size) { const context = canvas.getContext("2d"); context.imageSmoothingQuality = "high"; context.drawImage(image, 0, 0, size, size); - return canvas.toDataURL("image/png").split(",")[1]; + return { + png: canvas.toDataURL("image/png").split(",")[1], + rgba: Array.from(context.getImageData(0, 0, size, size).data), + }; }, { svg, size }, ); - return Buffer.from(base64, "base64"); + return { png: Buffer.from(png, "base64"), rgba: Buffer.from(rgba) }; +} + +// One 32-bit bottom-up DIB, the icon format Windows reads without a PNG decoder. The height in the header is twice the +// icon's because the AND mask that follows counts too; the mask is fully transparent (the alpha channel already says +// which pixels show). +function bmpEntry(size, rgba) { + const header = Buffer.alloc(40); + header.writeUInt32LE(40, 0); + header.writeInt32LE(size, 4); + header.writeInt32LE(size * 2, 8); + header.writeUInt16LE(1, 12); + header.writeUInt16LE(32, 14); + header.writeUInt32LE(size * size * 4, 20); + const pixels = Buffer.alloc(size * size * 4); + for (let y = 0; y < size; y += 1) { + for (let x = 0; x < size; x += 1) { + const source = (y * size + x) * 4; + const target = ((size - 1 - y) * size + x) * 4; + pixels[target] = rgba[source + 2]; + pixels[target + 1] = rgba[source + 1]; + pixels[target + 2] = rgba[source]; + pixels[target + 3] = rgba[source + 3]; + } + } + const maskStride = ((size + 31) >> 5) * 4; + return Buffer.concat([header, pixels, Buffer.alloc(maskStride * size)]); +} + +// A Windows .ico: a directory of images at the sizes Explorer, the taskbar and Alt+Tab ask for. PNG compresses the +// 256 px entry (Vista and later read it); the smaller ones stay plain DIBs, the format every Windows version reads. +function ico(entries) { + const header = Buffer.alloc(6); + header.writeUInt16LE(0, 0); + header.writeUInt16LE(1, 2); + header.writeUInt16LE(entries.length, 4); + const directory = Buffer.alloc(16 * entries.length); + let offset = header.length + directory.length; + entries.forEach(({ size, data }, index) => { + const entry = index * 16; + directory.writeUInt8(size === 256 ? 0 : size, entry); + directory.writeUInt8(size === 256 ? 0 : size, entry + 1); + directory.writeUInt16LE(1, entry + 4); + directory.writeUInt16LE(32, entry + 6); + directory.writeUInt32LE(data.length, entry + 8); + directory.writeUInt32LE(offset, entry + 12); + offset += data.length; + }); + return Buffer.concat([header, directory, ...entries.map(({ data }) => data)]); } async function main() { @@ -60,15 +114,21 @@ async function main() { try { const page = await browser.newPage(); const mark = await rasterize(page, markSvg, MARK_PNG); - fs.writeFileSync(path.join(root, "assets", "halation-mark.png"), mark); - fs.writeFileSync(path.join(root, "assets", "halation-app-icon.png"), await rasterize(page, icon, ICON_PNG)); - fs.writeFileSync(path.join(brand, "halation-mark-source.png"), mark); + fs.writeFileSync(path.join(root, "assets", "halation-mark.png"), mark.png); + fs.writeFileSync(path.join(root, "assets", "halation-app-icon.png"), (await rasterize(page, icon, ICON_PNG)).png); + const entries = []; + for (const size of ICO_SIZES) { + const image = await rasterize(page, icon, size); + entries.push({ size, data: size === 256 ? image.png : bmpEntry(size, image.rgba) }); + } + fs.writeFileSync(path.join(root, "assets", "halation-app-icon.ico"), ico(entries)); + fs.writeFileSync(path.join(brand, "halation-mark-source.png"), mark.png); fs.writeFileSync(path.join(brand, "halation-mark.svg"), markSvg); fs.writeFileSync(path.join(brand, "halation-app-icon.svg"), icon); } finally { await browser.close(); } - console.log("wrote assets/halation-mark.png, assets/halation-app-icon.png and docs/media/brand/"); + console.log("wrote assets/halation-mark.png, assets/halation-app-icon.png, assets/halation-app-icon.ico and docs/media/brand/"); } main().catch((error) => {