diff --git a/Cargo.toml b/Cargo.toml index 8b4218a..aa30a88 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,16 @@ [package] name = "anime-game-launcher" -version = "0.1.0" +version = "0.1.1" description = "Anime Game launcher" authors = ["Nikita Podvirnyy "] license = "GPL-3.0" edition = "2021" build = "build.rs" +[profile.release] +strip = true +lto = true + [build-dependencies] gtk4 = "0.4" diff --git a/anime-game-core b/anime-game-core index 93cff0f..f5c91f0 160000 --- a/anime-game-core +++ b/anime-game-core @@ -1 +1 @@ -Subproject commit 93cff0fc6a6b1904bedbff8e42f925602947befb +Subproject commit f5c91f01561cd12873e92bb51b37c7d68ca0cd99 diff --git a/assets/icons/64x64.ico b/assets/icons/64x64.ico new file mode 100644 index 0000000..8025d8b Binary files /dev/null and b/assets/icons/64x64.ico differ diff --git a/assets/resources.xml b/assets/resources.xml index 4a66f5a..c440f83 100644 --- a/assets/resources.xml +++ b/assets/resources.xml @@ -1,6 +1,9 @@ - - images/icon.png + + images/icon.png + + + icons/64x64.ico diff --git a/assets/ui/main.blp b/assets/ui/main.blp index ecc879f..1b100da 100644 --- a/assets/ui/main.blp +++ b/assets/ui/main.blp @@ -5,7 +5,7 @@ Adw.ApplicationWindow window { default-width: 900; default-height: 600; - styles ["devel"] + icon-name: "resource:///org/app/assets/icons/64x64"; content: Adw.ToastOverlay toast_overlay { Adw.Leaflet leaflet { diff --git a/src/main.rs b/src/main.rs index 7526d86..440e3ed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,9 @@ use gtk4::{self as gtk, prelude::*}; use libadwaita::{self as adw, prelude::*}; -use gtk::{CssProvider, StyleContext, gdk::Display, STYLE_PROVIDER_PRIORITY_APPLICATION}; +use gtk::{CssProvider, StyleContext, STYLE_PROVIDER_PRIORITY_APPLICATION}; +use gtk::gdk::Display; +use gtk::glib::set_application_name; pub mod ui; pub mod lib; @@ -10,6 +12,7 @@ use ui::*; pub const APP_ID: &str = "com.gitlab.an-anime-team.an-anime-game-launcher-gtk"; pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const APP_DEBUG: bool = cfg!(debug_assertions); #[tokio::main] async fn main() { @@ -20,6 +23,10 @@ async fn main() { gtk::gio::resources_register_include!(".assets.gresource") .expect("Failed to register resources"); + // Set application's title + // FIXME: doesn't work? + set_application_name("An Anime Game Launcher"); + // Create app let application = gtk::Application::new( Some(APP_ID), diff --git a/src/ui/main.rs b/src/ui/main.rs index fdc678b..fbcbff3 100644 --- a/src/ui/main.rs +++ b/src/ui/main.rs @@ -74,16 +74,36 @@ impl AppWidgets { preferences_stack: PreferencesStack::new(window, toast_overlay)? }; + // Set devel style to ApplicationWindow if it's debug mode + if crate::APP_DEBUG { + result.window.add_css_class("devel"); + } + // Set default About Dialog values - result.about.set_version(Some(crate::APP_VERSION)); + if crate::APP_DEBUG { + result.about.set_version(Some(format!("{} (development)", crate::APP_VERSION).as_str())); + } + + else { + result.about.set_version(Some(crate::APP_VERSION)); + } + result.about.set_license_type(gtk::License::Gpl30); result.about.set_authors(&[ "Nikita Podvirnyy " ]); + let curl_info = anime_game_core::curl_sys::Version::get(); + result.about.set_system_information(Some(&[ - format!("Anime Game core library version: {}", anime_game_core::VERSION) + format!("Anime Game core library version: {}", anime_game_core::VERSION), + format!(" Curl version: {}", curl_info.version()), + format!(" SSL version: {}", curl_info.ssl_version().unwrap_or("?")), + String::new(), + format!("GTK version: {}.{}.{}", gtk::major_version(), gtk::minor_version(), gtk::micro_version()), + format!("Libadwaita version: {}.{}.{}", adw::major_version(), adw::minor_version(), adw::micro_version()), + format!("Pango version: {}", gtk::pango::version_string().unwrap_or("?".into())), ].join("\n"))); // Add preferences page to the leaflet