Several changes

- upscaled logo to 512x512; added source link
- bundled all the UI files into gtk resources
This commit is contained in:
Observer KRypt0n_ 2022-08-02 18:43:07 +02:00
parent 0990340a2b
commit 0baa3593ac
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
15 changed files with 38 additions and 16 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 KiB

After

Width:  |  Height:  |  Size: 209 KiB

View file

@ -1,6 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/app/assets/images">
<file alias="icon.png">images/icon.png</file>
<gresource prefix="/org/app/assets">
<file compressed="true">images/icon.png</file>
</gresource>
<gresource prefix="/org/app/ui">
<file preprocess="xml-stripblanks" compressed="true" alias="main.ui">ui/.dist/main.ui</file>
<file preprocess="xml-stripblanks" compressed="true" alias="first_run.ui">ui/.dist/first_run.ui</file>
<file preprocess="xml-stripblanks" compressed="true" alias="preferences.ui">ui/.dist/preferences.ui</file>
</gresource>
<gresource prefix="/org/app/ui/first_run">
<file preprocess="xml-stripblanks" compressed="true" alias="page_1.ui">ui/.dist/first_run/page_1.ui</file>
<file preprocess="xml-stripblanks" compressed="true" alias="page_2.ui">ui/.dist/first_run/page_2.ui</file>
<file preprocess="xml-stripblanks" compressed="true" alias="page_3.ui">ui/.dist/first_run/page_3.ui</file>
<file preprocess="xml-stripblanks" compressed="true" alias="page_4.ui">ui/.dist/first_run/page_4.ui</file>
<file preprocess="xml-stripblanks" compressed="true" alias="page_5.ui">ui/.dist/first_run/page_5.ui</file>
<file preprocess="xml-stripblanks" compressed="true" alias="page_6.ui">ui/.dist/first_run/page_6.ui</file>
</gresource>
<gresource prefix="/org/app/ui/preferences">
<file preprocess="xml-stripblanks" compressed="true" alias="general.ui">ui/.dist/preferences/general.ui</file>
<file preprocess="xml-stripblanks" compressed="true" alias="enhancements.ui">ui/.dist/preferences/enhancements.ui</file>
<file preprocess="xml-stripblanks" compressed="true" alias="environment.ui">ui/.dist/preferences/environment.ui</file>
</gresource>
</gresources>

View file

@ -74,6 +74,8 @@ fn blp_process_dir(dir: String) {
}
fn main() {
blp_process_dir(String::new());
if let Ok(_) = read_to_string("assets/resources.xml") {
gtk4::gio::compile_resources(
"assets",
@ -81,6 +83,4 @@ fn main() {
".assets.gresource",
);
}
blp_process_dir(String::new());
}

View file

@ -46,7 +46,7 @@ pub struct AppWidgets {
impl AppWidgets {
pub fn try_get() -> Result<Self, String> {
let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/first_run.ui"));
let builder = gtk::Builder::from_resource("/org/app/ui/first_run.ui");
let result = Self {
window: get_object(&builder, "window")?,

View file

@ -10,7 +10,7 @@ pub struct Page {
impl Page {
pub fn new() -> Result<Self, String> {
let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/first_run/page_1.ui"));
let builder = gtk::Builder::from_resource("/org/app/ui/first_run/page_1.ui");
Ok(Self {
page: get_object(&builder, "page")?,

View file

@ -18,7 +18,7 @@ pub struct Page {
impl Page {
pub fn new() -> Result<Self, String> {
let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/first_run/page_2.ui"));
let builder = gtk::Builder::from_resource("/org/app/ui/first_run/page_2.ui");
let result = Self {
page: get_object(&builder, "page")?,

View file

@ -11,7 +11,7 @@ pub struct Page {
impl Page {
pub fn new() -> Result<Self, String> {
let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/first_run/page_3.ui"));
let builder = gtk::Builder::from_resource("/org/app/ui/first_run/page_3.ui");
Ok(Self {
page: get_object(&builder, "page")?,

View file

@ -53,7 +53,7 @@ pub struct Page {
impl Page {
pub fn new(window: gtk::Window) -> Result<Self, String> {
let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/first_run/page_4.ui"));
let builder = gtk::Builder::from_resource("/org/app/ui/first_run/page_4.ui");
let result = Self {
window,

View file

@ -19,7 +19,7 @@ pub struct Page {
impl Page {
pub fn new() -> Result<Self, String> {
let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/first_run/page_5.ui"));
let builder = gtk::Builder::from_resource("/org/app/ui/first_run/page_5.ui");
Ok(Self {
page: get_object(&builder, "page")?,

View file

@ -11,7 +11,7 @@ pub struct Page {
impl Page {
pub fn new() -> Result<Self, String> {
let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/first_run/page_6.ui"));
let builder = gtk::Builder::from_resource("/org/app/ui/first_run/page_6.ui");
Ok(Self {
page: get_object(&builder, "page")?,

View file

@ -55,7 +55,7 @@ pub struct AppWidgets {
impl AppWidgets {
pub fn try_get() -> Result<Self, String> {
let builder = gtk::Builder::from_string(include_str!("../../assets/ui/.dist/main.ui"));
let builder = gtk::Builder::from_resource("/org/app/ui/main.ui");
let window = get_object::<adw::ApplicationWindow>(&builder, "window")?;
let toast_overlay = get_object::<adw::ToastOverlay>(&builder, "toast_overlay")?;
@ -103,6 +103,10 @@ impl AppWidgets {
"Nikita Podvirnyy <suimin.tu.mu.ga.mi@gmail.com>"
]);
result.about.add_credit_section("Logo", &[
"@nightany https://pinterest.com/pin/356206651788051017"
]);
let curl_info = anime_game_core::curl_sys::Version::get();
result.about.set_system_information(Some(&[

View file

@ -31,7 +31,7 @@ pub struct AppWidgets {
impl AppWidgets {
fn try_get() -> Result<Self, String> {
let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/preferences/enhancements.ui"));
let builder = gtk::Builder::from_resource("/org/app/ui/preferences/enhancements.ui");
let result = Self {
page: get_object(&builder, "page")?,

View file

@ -32,7 +32,7 @@ pub struct AppWidgets {
impl AppWidgets {
fn try_get() -> Result<Self, String> {
let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/preferences/environment.ui"));
let builder = gtk::Builder::from_resource("/org/app/ui/preferences/environment.ui");
let result = Self {
page: get_object(&builder, "page")?,

View file

@ -56,7 +56,7 @@ pub struct AppWidgets {
impl AppWidgets {
pub fn try_get() -> Result<Self, String> {
let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/preferences/general.ui"));
let builder = gtk::Builder::from_resource("/org/app/ui/preferences/general.ui");
let mut result = Self {
page: get_object(&builder, "page")?,

View file

@ -39,7 +39,7 @@ pub struct PreferencesStack {
impl PreferencesStack {
pub fn new() -> Result<Self, String> {
let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/preferences.ui"));
let builder = gtk::Builder::from_resource("/org/app/ui/preferences.ui");
let result = Self {
app: Default::default(),