856f865cf98d
os_window.rs
//! The app id every PhotoCraft OS window carries: the main window (`main.rs`), the runtime's
//! windows (`InstallSpec::app_id`) and the extra windows built with [`builder`], so docks show
//! the PhotoCraft icon on them and Wayland compositors' window rules can match them (Hyprland's
//! `class:`, #6697). Without one the app id is empty.
/// Matches the `.desktop` file and hicolor icon name, so Wayland docks pick up the icon.
pub const APP_ID: &str = "ai.storyteller.photocraft";
/// A builder for an extra OS window, carrying [`APP_ID`].
pub fn builder() -> egui::ViewportBuilder {
egui::ViewportBuilder::default().with_app_id(APP_ID)
}
#[cfg(test)]
mod tests {
#[test]
fn extra_windows_carry_the_app_id() {
assert_eq!(super::builder().app_id.as_deref(), Some("ai.storyteller.photocraft"));
}
}
No file is open. Choose one in the tree, or press Ctrl+O (⌘O on a Mac) to find one by name.
Syntax highlighting could not load. The unmodified read-only text remains available above.