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
45 changes: 45 additions & 0 deletions Cargo.lock

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

13 changes: 5 additions & 8 deletions assets/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Binary file added assets/halation-app-icon.ico
Binary file not shown.
Binary file modified assets/halation-app-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/halation-mark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions crates/halation-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
29 changes: 29 additions & 0 deletions crates/halation-app/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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/<profile>`: 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() {
Expand Down
77 changes: 76 additions & 1 deletion crates/halation-app/src/screenshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ pub fn run(spec: ScreenshotSpec) -> Result<(), Box<dyn std::error::Error>> {
let (page, mode, section) = match spec.page.as_str() {
"home" => (0, 0, -1),
"home-open" => (0, 2, -1),
"motion-home" => (0, 6, -1),
"motion-settings" => (3, 7, -1),
"motion-sidebar" => (0, 8, -1),
"settings" => (3, 0, -1),
"converter" => (4, 0, -1),
"converter-open" => (4, 2, -1),
Expand All @@ -209,12 +212,15 @@ pub fn run(spec: ScreenshotSpec) -> Result<(), Box<dyn std::error::Error>> {
Some(section) if (0..8).contains(&section) => (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, settings, settings-<0..7>, converter, converter-open, converter-ready, converter-audio, converter-video, motion-home, motion-settings or motion-sidebar"
)
.into());
}
},
};
if (6..=8).contains(&mode) && (spec.width != 1440 || spec.height != 900) {
return Err("motion sequences use 1440x900 fixed pointer fixtures".into());
}
// Absolute, like a real profile: FFmpeg runs in its own folder
let out_dir = std::path::absolute(
spec.out
Expand Down Expand Up @@ -330,8 +336,77 @@ pub fn run(spec: ScreenshotSpec) -> Result<(), Box<dyn std::error::Error>> {
pump(&queue, Duration::from_millis(300));
}

if (6..=8).contains(&mode) {
// Real headless pointer events; never set UI hover properties and never touch the desktop. Capture departure,
// detachment, rest, reversal, and exit, not just an attractive final frame. Times are wall-clock approximations.
// Hold the same decoded Drape frame in every capture: otherwise the ambient movie changes the pixels we
// compare for hover-only changes. This changes the diagnostic render only, not the production player.
let backdrop = ui.get_backdrop();
let capture = |name: &str| -> Result<(), Box<dyn std::error::Error>> {
ui.set_backdrop(backdrop.clone());
let mut pixels = vec![Rgb8Pixel::new(0, 0, 0); (spec.width * spec.height) as usize];
window.request_redraw();
window.draw_if_needed(|renderer| {
renderer.render(&mut pixels, spec.width as usize);
});
let stem = spec.out.file_stem().unwrap_or_default().to_string_lossy();
write_png(
&spec.out.with_file_name(format!("{stem}-{name}.png")),
spec.width,
spec.height,
&pixels,
)?;
Ok(())
};
let point = |x, y| {
ui.window()
.dispatch_event(slint::platform::WindowEvent::PointerMoved {
position: slint::LogicalPosition::new(x, y),
})
};
capture("idle")?;
let (first, second) = match mode {
6 => ((500.0, 390.0), (860.0, 390.0)),
7 => ((195.0, 78.0), (300.0, 78.0)),
_ => ((30.0, 82.0), (30.0, 166.0)),
};
point(first.0, first.1);
pump(&queue, Duration::from_millis(400));
capture("entered")?;
point(second.0, second.1);
for (name, wait) in [
("move-016", 16),
("move-048", 32),
("move-096", 48),
("move-160", 64),
("settled", 300),
] {
pump(&queue, Duration::from_millis(wait));
capture(name)?;
}
point(first.0, first.1);
pump(&queue, Duration::from_millis(32));
capture("reverse-032")?;
ui.window()
.dispatch_event(slint::platform::WindowEvent::PointerExited);
pump(&queue, Duration::from_millis(400));
capture("exit")?;
if mode == 6 {
point(746.0, 680.0);
pump(&queue, Duration::from_millis(400));
capture("drop-hover")?;
point(450.0, 680.0);
pump(&queue, Duration::from_millis(400));
capture("drop-hover-left")?;
ui.window()
.dispatch_event(slint::platform::WindowEvent::PointerExited);
pump(&queue, Duration::from_millis(400));
capture("drop-exit")?;
}
}
let (w, h) = (spec.width as usize, spec.height as usize);
let mut buffer = vec![Rgb8Pixel::new(0, 0, 0); w * h];
window.request_redraw();
let drawn = window.draw_if_needed(|renderer| {
renderer.render(&mut buffer, w);
});
Expand Down
Loading
Loading