Files
musyx/crates/musyx/src/main.rs
T
yuriy.pandClaude Opus 5.5 4b1f0bb8a0 feat: Windows release packaging
Embed the app icon and version info into the exe, generated from
musyx.png by tool/make_ico.ps1, and hide the console window in
release builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 01:06:42 +06:00

50 lines
1.4 KiB
Rust

// No console window behind the app in Windows release builds.
#![cfg_attr(all(windows, not(debug_assertions)), windows_subsystem = "windows")]
mod app;
mod covers;
mod i18n;
mod media;
mod menubar;
mod player;
mod route;
mod screens;
mod session;
mod store;
#[cfg(feature = "snapshot")]
mod snapshot;
mod ui;
mod widgets;
use iced::{Size, window};
use app::App;
use ui::theme;
/// The Linux application id: the window's Wayland app id / X11 class and the `.desktop` name.
#[cfg(target_os = "linux")]
const APP_ID: &str = "it.panov.musyx.desktop";
fn main() -> iced::Result {
let app = iced::application(App::new, App::update, App::view)
.title(App::title)
.theme(App::theme)
.subscription(App::subscription)
.default_font(theme::BODY)
.window(window::Settings {
size: Size::new(1280.0, 800.0),
min_size: Some(Size::new(960.0, 620.0)),
icon: window::icon::from_file_data(include_bytes!("../assets/icon/musyx.png"), None).ok(),
// Matches the installed `it.panov.musyx.desktop.desktop`, so the shell shows its name and icon.
#[cfg(target_os = "linux")]
platform_specific: window::settings::PlatformSpecific {
application_id: APP_ID.to_owned(),
..Default::default()
},
..window::Settings::default()
})
.centered();
theme::FONTS.into_iter().fold(app, |app, font| app.font(font)).run()
}