- added more system data in about dialog
- updated core library
This commit is contained in:
Observer KRypt0n_ 2022-07-26 17:34:46 +02:00
parent 9860c54dc1
commit daac4c8ff0
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
7 changed files with 42 additions and 8 deletions

View file

@ -1,12 +1,16 @@
[package] [package]
name = "anime-game-launcher" name = "anime-game-launcher"
version = "0.1.0" version = "0.1.1"
description = "Anime Game launcher" description = "Anime Game launcher"
authors = ["Nikita Podvirnyy <suimin.tu.mu.ga.mi@gmail.com>"] authors = ["Nikita Podvirnyy <suimin.tu.mu.ga.mi@gmail.com>"]
license = "GPL-3.0" license = "GPL-3.0"
edition = "2021" edition = "2021"
build = "build.rs" build = "build.rs"
[profile.release]
strip = true
lto = true
[build-dependencies] [build-dependencies]
gtk4 = "0.4" gtk4 = "0.4"

@ -1 +1 @@
Subproject commit 93cff0fc6a6b1904bedbff8e42f925602947befb Subproject commit f5c91f01561cd12873e92bb51b37c7d68ca0cd99

BIN
assets/icons/64x64.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<gresources> <gresources>
<gresource prefix="/org/app/assets/"> <gresource prefix="/org/app/assets/images">
<file>images/icon.png</file> <file alias="icon.png">images/icon.png</file>
</gresource>
<gresource prefix="/org/app/assets/icons">
<file alias="64x64">icons/64x64.ico</file>
</gresource> </gresource>
</gresources> </gresources>

View file

@ -5,7 +5,7 @@ Adw.ApplicationWindow window {
default-width: 900; default-width: 900;
default-height: 600; default-height: 600;
styles ["devel"] icon-name: "resource:///org/app/assets/icons/64x64";
content: Adw.ToastOverlay toast_overlay { content: Adw.ToastOverlay toast_overlay {
Adw.Leaflet leaflet { Adw.Leaflet leaflet {

View file

@ -1,7 +1,9 @@
use gtk4::{self as gtk, prelude::*}; use gtk4::{self as gtk, prelude::*};
use libadwaita::{self as adw, 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 ui;
pub mod lib; 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_ID: &str = "com.gitlab.an-anime-team.an-anime-game-launcher-gtk";
pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION"); pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION");
pub const APP_DEBUG: bool = cfg!(debug_assertions);
#[tokio::main] #[tokio::main]
async fn main() { async fn main() {
@ -20,6 +23,10 @@ async fn main() {
gtk::gio::resources_register_include!(".assets.gresource") gtk::gio::resources_register_include!(".assets.gresource")
.expect("Failed to register resources"); .expect("Failed to register resources");
// Set application's title
// FIXME: doesn't work?
set_application_name("An Anime Game Launcher");
// Create app // Create app
let application = gtk::Application::new( let application = gtk::Application::new(
Some(APP_ID), Some(APP_ID),

View file

@ -74,16 +74,36 @@ impl AppWidgets {
preferences_stack: PreferencesStack::new(window, toast_overlay)? 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 // Set default About Dialog values
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_version(Some(crate::APP_VERSION));
}
result.about.set_license_type(gtk::License::Gpl30); result.about.set_license_type(gtk::License::Gpl30);
result.about.set_authors(&[ result.about.set_authors(&[
"Nikita Podvirnyy <suimin.tu.mu.ga.mi@gmail.com>" "Nikita Podvirnyy <suimin.tu.mu.ga.mi@gmail.com>"
]); ]);
let curl_info = anime_game_core::curl_sys::Version::get();
result.about.set_system_information(Some(&[ 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"))); ].join("\n")));
// Add preferences page to the leaflet // Add preferences page to the leaflet