[fractal/fractal-next] Add custom icon theme and move resource file



commit f0fb42d7b8842b3f62564246fefdf231c21fc95f
Author: Julian Sparber <julian sparber net>
Date:   Mon Feb 15 17:44:07 2021 +0100

    Add custom icon theme and move resource file

 data/meson.build                       | 10 +---------
 data/resources.gresource.xml           |  9 ---------
 data/resources/meson.build             |  8 ++++++++
 data/resources/resources.gresource.xml | 13 +++++++++++++
 src/main.rs                            |  6 ++++++
 5 files changed, 28 insertions(+), 18 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index cc26f989..282da6bf 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -72,12 +72,4 @@ if glib_compile_schemas.found()
   )
 endif
 
-# Resources
-resources = gnome.compile_resources(
-  'resources',
-  'resources.gresource.xml',
-  gresource_bundle: true,
-  source_dir: meson.current_build_dir(),
-  install: true,
-  install_dir: pkgdatadir,
-)
+subdir('resources')
diff --git a/data/resources/meson.build b/data/resources/meson.build
new file mode 100644
index 00000000..67bc2519
--- /dev/null
+++ b/data/resources/meson.build
@@ -0,0 +1,8 @@
+# Resources
+resources = gnome.compile_resources(
+  'resources',
+  'resources.gresource.xml',
+  gresource_bundle: true,
+  install: true,
+  install_dir: pkgdatadir,
+)
diff --git a/data/resources/resources.gresource.xml b/data/resources/resources.gresource.xml
new file mode 100644
index 00000000..75e043dd
--- /dev/null
+++ b/data/resources/resources.gresource.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/FractalNext/">
+    <file compressed="true" preprocess="xml-stripblanks" alias="shortcuts.ui">ui/shortcuts.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks" alias="content.ui">ui/content.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks" alias="login.ui">ui/login.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks" alias="session.ui">ui/session.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks" alias="sidebar.ui">ui/sidebar.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks" alias="window.ui">ui/window.ui</file>
+    <file compressed="true">style.css</file>
+    <file preprocess="xml-stripblanks">icons/scalable/actions/send-symbolic.svg</file>
+  </gresource>
+</gresources>
diff --git a/src/main.rs b/src/main.rs
index e0bdb1b0..4ab963e9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -6,7 +6,9 @@ mod window;
 use application::ExampleApplication;
 use config::{GETTEXT_PACKAGE, LOCALEDIR, RESOURCES_FILE};
 use gettextrs::*;
+use gtk::gdk::Display;
 use gtk::gio;
+use gtk::IconTheme;
 
 fn main() {
     // Initialize logger, debug is carried out via debug!, info!, and warn!.
@@ -25,6 +27,10 @@ fn main() {
     let res = gio::Resource::load(RESOURCES_FILE).expect("Could not load gresource file");
     gio::resources_register(&res);
 
+    IconTheme::get_for_display(&Display::get_default().unwrap())
+        .unwrap()
+        .add_resource_path("/org/gnome/FractalNext/icons");
+
     let app = ExampleApplication::new();
     app.run();
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]