This commit is contained in:
Julian Chang 2026-07-21 06:03:30 +09:00
commit bf6ee14add
No known key found for this signature in database
5 changed files with 30 additions and 6 deletions

11
Cargo.lock generated
View file

@ -4509,6 +4509,7 @@ dependencies = [
"tracing",
"tracing-subscriber",
"uuid 1.23.1",
"winresource",
]
[[package]]
@ -8137,6 +8138,16 @@ dependencies = [
"memchr",
]
[[package]]
name = "winresource"
version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0986a8b1d586b7d3e4fe3d9ea39fb451ae22869dcea4aa109d287a374d866087"
dependencies = [
"toml",
"version_check",
]
[[package]]
name = "wit-bindgen"
version = "0.51.0"

View file

@ -47,9 +47,9 @@ freya.workspace = true
[target.'cfg(target_os = "macos")'.dependencies]
mimalloc = "=0.1.52"
# Build then package (per OS):
# cargo build --release -p oneclient_app
# cargo packager --release -p oneclient_app --formats <nsis|app,dmg|deb,appimage>
[target.'cfg(windows)'.build-dependencies]
winresource = "=0.1.31"
[package.metadata.packager]
product-name = "OneClient"
identifier = "org.polyfrost.OneClient"

View file

@ -0,0 +1,10 @@
fn main() {
// Embeds the app icon into the Windows executable.
#[cfg(windows)]
{
let mut res = winresource::WindowsResource::new();
res.set_icon("icons/icon.ico");
res.compile()
.expect("failed to embed Windows icon resource");
}
}

View file

@ -1,2 +1,2 @@
pub const APP_ID: &str = "org.polyfrost.OneClient";
pub const WINDOW_APP_ID: &str = "oneclient_app";
pub const WINDOW_TITLE: &str = "OneClient";

View file

@ -63,7 +63,10 @@ fn main() {
.with_window(
WindowConfig::new_app(OneClientApp { bridge })
.with_title(constants::WINDOW_TITLE)
.with_app_id(constants::APP_ID)
.with_app_id(constants::WINDOW_APP_ID)
.with_icon(LaunchConfig::window_icon(include_bytes!(
"../icons/128x128.png"
)))
.with_size(1200., 800.)
.with_min_size(800., 600.)
.with_decorations(false)
@ -74,7 +77,7 @@ fn main() {
std::env::var("ONECLIENT_GPU_CACHE_MB")
.ok()
.and_then(|v| v.parse::<usize>().ok())
.unwrap_or(32),
.unwrap_or(32 * 1024 * 1024),
)
.with_default_font(theme::DEFAULT_FONT);