From 0350c6951a40cb74ea9585ea4bd326f31b859b1a Mon Sep 17 00:00:00 2001 From: Brage Fuglseth Date: Wed, 23 Aug 2023 09:59:52 +0200 Subject: [PATCH 1/5] Library illustration --- data/assets/library.svg | 757 ++++++++++++++++++++++++++++++++++++++++ data/meson.build | 1 + src/Library/Library.blp | 5 + src/Library/Library.js | 7 + src/about.js | 1 + 5 files changed, 771 insertions(+) create mode 100644 data/assets/library.svg diff --git a/data/assets/library.svg b/data/assets/library.svg new file mode 100644 index 000000000..3498c520c --- /dev/null +++ b/data/assets/library.svg @@ -0,0 +1,757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/meson.build b/data/meson.build index cfc707f0c..94525b2cc 100644 --- a/data/meson.build +++ b/data/meson.build @@ -66,3 +66,4 @@ if compile_schemas.found() endif install_subdir('icons/hicolor', install_dir : join_paths(get_option('datadir'), 'icons')) +install_subdir('assets', install_dir: pkgdatadir) diff --git a/src/Library/Library.blp b/src/Library/Library.blp index f2edafbcd..3b84f2aaa 100644 --- a/src/Library/Library.blp +++ b/src/Library/Library.blp @@ -10,6 +10,11 @@ Adw.PreferencesWindow library { Adw.PreferencesPage { Adw.PreferencesGroup { + Picture illustration { + can-shrink: false; + margin-bottom: 30; + } + Label { label: _("Learn, Test, Remix"); styles ["title-1"] diff --git a/src/Library/Library.js b/src/Library/Library.js index 8496861ee..01d10db7d 100644 --- a/src/Library/Library.js +++ b/src/Library/Library.js @@ -12,6 +12,13 @@ export default function Library({ application }) { const builder = Gtk.Builder.new_from_resource(resource); const window = builder.get_object("library"); + let illustration_file = Gio.File.new_for_path( + pkg.pkgdatadir + ).resolve_relative_path("assets/library.svg"); + console.log("badonk"); + const illustration = builder.get_object("illustration"); + illustration.set_file(illustration_file); + let last_selected; const demos = getDemos(); diff --git a/src/about.js b/src/about.js index e8fb49cbd..405c3f1f6 100644 --- a/src/about.js +++ b/src/about.js @@ -52,6 +52,7 @@ ${getBlueprintVersion()} artists: [ "Tobias Bernard ", "Jakub Steiner https://jimmac.eu", + "Brage Fuglseth https://bragefuglseth.dev", ], }); From 00dbbd1451bbf1361b5f2c5998ed3c880a73a653 Mon Sep 17 00:00:00 2001 From: Brage Fuglseth Date: Wed, 23 Aug 2023 10:03:58 +0200 Subject: [PATCH 2/5] remove temp. console log I used for debugging --- src/Library/Library.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Library/Library.js b/src/Library/Library.js index 01d10db7d..d49175a83 100644 --- a/src/Library/Library.js +++ b/src/Library/Library.js @@ -15,7 +15,6 @@ export default function Library({ application }) { let illustration_file = Gio.File.new_for_path( pkg.pkgdatadir ).resolve_relative_path("assets/library.svg"); - console.log("badonk"); const illustration = builder.get_object("illustration"); illustration.set_file(illustration_file); From 7443ca45cf90eea00f1587f1c0ca17c34a2c8054 Mon Sep 17 00:00:00 2001 From: Brage Fuglseth Date: Wed, 23 Aug 2023 10:05:48 +0200 Subject: [PATCH 3/5] make illustration file a const --- src/Library/Library.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Library/Library.js b/src/Library/Library.js index d49175a83..c8cc642f0 100644 --- a/src/Library/Library.js +++ b/src/Library/Library.js @@ -12,7 +12,7 @@ export default function Library({ application }) { const builder = Gtk.Builder.new_from_resource(resource); const window = builder.get_object("library"); - let illustration_file = Gio.File.new_for_path( + const illustration_file = Gio.File.new_for_path( pkg.pkgdatadir ).resolve_relative_path("assets/library.svg"); const illustration = builder.get_object("illustration"); From 6098ae2ef0822a10f3900e24c033148cc9aee4d0 Mon Sep 17 00:00:00 2001 From: Brage Fuglseth <91388039+bragefuglseth@users.noreply.github.com> Date: Thu, 24 Aug 2023 06:44:56 +0200 Subject: [PATCH 4/5] Move to gresource for illustration Co-authored-by: Sonny Piers --- src/Library/Library.blp | 2 +- src/Library/Library.js | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Library/Library.blp b/src/Library/Library.blp index 3b84f2aaa..cfcf1bfe1 100644 --- a/src/Library/Library.blp +++ b/src/Library/Library.blp @@ -10,7 +10,7 @@ Adw.PreferencesWindow library { Adw.PreferencesPage { Adw.PreferencesGroup { - Picture illustration { + Picture picture_illustration { can-shrink: false; margin-bottom: 30; } diff --git a/src/Library/Library.js b/src/Library/Library.js index c8cc642f0..0773f5377 100644 --- a/src/Library/Library.js +++ b/src/Library/Library.js @@ -12,11 +12,8 @@ export default function Library({ application }) { const builder = Gtk.Builder.new_from_resource(resource); const window = builder.get_object("library"); - const illustration_file = Gio.File.new_for_path( - pkg.pkgdatadir - ).resolve_relative_path("assets/library.svg"); - const illustration = builder.get_object("illustration"); - illustration.set_file(illustration_file); + const picture_illustration = builder.get_object("picture_illustration"); + picture_illustration.set_resource(illustration); let last_selected; From 332512968ba5500ff390e9be499027fff885791f Mon Sep 17 00:00:00 2001 From: Brage Fuglseth Date: Thu, 24 Aug 2023 06:50:39 +0200 Subject: [PATCH 5/5] accomodate move to gresource --- data/meson.build | 1 - src/Library/Library.js | 2 ++ {data/assets => src/Library}/library.svg | 0 3 files changed, 2 insertions(+), 1 deletion(-) rename {data/assets => src/Library}/library.svg (100%) diff --git a/data/meson.build b/data/meson.build index 94525b2cc..cfc707f0c 100644 --- a/data/meson.build +++ b/data/meson.build @@ -66,4 +66,3 @@ if compile_schemas.found() endif install_subdir('icons/hicolor', install_dir : join_paths(get_option('datadir'), 'icons')) -install_subdir('assets', install_dir: pkgdatadir) diff --git a/src/Library/Library.js b/src/Library/Library.js index 0773f5377..a742203aa 100644 --- a/src/Library/Library.js +++ b/src/Library/Library.js @@ -8,6 +8,8 @@ import Window from "../window.js"; import resource from "./Library.blp"; import { createSessionFromDemo } from "../sessions.js"; +import illustration from "./library.svg"; + export default function Library({ application }) { const builder = Gtk.Builder.new_from_resource(resource); const window = builder.get_object("library"); diff --git a/data/assets/library.svg b/src/Library/library.svg similarity index 100% rename from data/assets/library.svg rename to src/Library/library.svg