Updated libs, added icon to the gtk resources

This commit is contained in:
Observer KRypt0n_ 2022-07-24 14:02:14 +02:00
parent 83d1a4cdf8
commit a6667f73d4
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
9 changed files with 77 additions and 5 deletions

View file

@ -7,6 +7,9 @@ license = "GPL-3.0"
edition = "2021"
build = "build.rs"
[build-dependencies]
gtk4 = "0.4"
[dependencies]
gtk4 = "0.4"
libadwaita = "0.1"
@ -17,7 +20,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
dirs = "4.0.0"
tokio = { version = "1.19.2", features = ["rt", "rt-multi-thread", "macros"] }
tokio = { version = "1.20", features = ["rt", "rt-multi-thread", "macros"] }
wait_not_await = "0.2.1"
regex = "1.6.0"
lazy_static = "1.4.0"

@ -1 +1 @@
Subproject commit f4ad7711ac156c4c69bc8a14c896f07ad54a101c
Subproject commit ccb2f2082ad278cce946ebd960e4a065368babaf

6
assets/resources.xml Normal file
View file

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

View file

@ -34,7 +34,8 @@ Adw.ApplicationWindow window {
Adw.PreferencesGroup {
Gtk.Image {
file: "assets/images/icon.png";
resource: "/org/app/assets/images/icon.png";
vexpand: true;
margin-top: 48;
}

@ -1 +1 @@
Subproject commit 08da6f79c7a4fee9212ef82d8c6c8095fc7644ce
Subproject commit 30f0deea34851aa6fbb4f8a5dcd9216f5ac714f9

View file

@ -1,5 +1,5 @@
use std::process::{Command, Stdio};
use std::fs::{self, read_dir, create_dir_all};
use std::fs::{self, read_dir, create_dir_all, read_to_string};
use std::path::Path;
fn compile_blueprint<T: ToString>(path: T) -> Result<String, String> {
@ -27,11 +27,21 @@ fn compile_blueprint<T: ToString>(path: T) -> Result<String, String> {
}
fn main() {
if let Ok(_) = read_to_string("assets/resources.xml") {
gtk4::gio::compile_resources(
"assets",
"assets/resources.xml",
".assets.gresource",
);
}
if let Ok(entries) = read_dir("assets/ui") {
if let Err(_) = read_dir("assets/ui/.dist") {
create_dir_all("assets/ui/.dist").expect("UI dist dir couldn't be created");
}
println!("cargo:rerun-if-changed=assets/ui/*.blp");
for entry in entries {
if let Ok(entry) = entry {
if let Ok(metadata) = entry.metadata() {

48
external/hpatchz/LICENSE vendored Normal file
View file

@ -0,0 +1,48 @@
MIT License
HDiffPatch
Copyright (c) 2012-2021 housisong
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
----------------------------------------------------------------------------------
libdivsufsort
Copyright (c) 2003-2008 Yuta Mori All Rights Reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

BIN
external/hpatchz/hpatchz vendored Executable file

Binary file not shown.

View file

@ -13,6 +13,10 @@ async fn main() {
gtk::init().expect("GTK initialization failed");
adw::init();
// Register and include resources
gtk::gio::resources_register_include!(".assets.gresource")
.expect("Failed to register resources");
// Create app
let application = gtk::Application::new(
Some("com.gitlab.an-anime-team.an-anime-game-launcher-gtk"),