diff --git a/build-aux/flatpak/page.kramo.Cartridges.Devel.json b/build-aux/flatpak/page.kramo.Cartridges.Devel.json index fdbcff6..f0f217f 100644 --- a/build-aux/flatpak/page.kramo.Cartridges.Devel.json +++ b/build-aux/flatpak/page.kramo.Cartridges.Devel.json @@ -1,138 +1,147 @@ { - "id" : "page.kramo.Cartridges.Devel", - "runtime" : "org.gnome.Platform", - "runtime-version" : "46", - "sdk" : "org.gnome.Sdk", - "command" : "cartridges", - "finish-args" : [ - "--share=network", - "--share=ipc", - "--socket=fallback-x11", - "--device=dri", - "--socket=wayland", - "--talk-name=org.freedesktop.Flatpak", - "--filesystem=host", - "--filesystem=~/.var/app/com.valvesoftware.Steam/data/Steam/:ro", - "--filesystem=~/.var/app/net.lutris.Lutris/:ro", - "--filesystem=~/.var/app/com.heroicgameslauncher.hgl/config/heroic/:ro", - "--filesystem=~/.var/app/com.heroicgameslauncher.hgl/config/legendary/:ro", - "--filesystem=~/.var/app/com.usebottles.bottles/data/bottles/:ro", - "--filesystem=~/.var/app/io.itch.itch/config/itch/:ro", - "--filesystem=~/.var/app/org.libretro.RetroArch/config/retroarch/:ro", - "--filesystem=/var/lib/flatpak/app:ro", - "--filesystem=/var/lib/flatpak/exports:ro", - "--filesystem=xdg-data/flatpak/app:ro", - "--filesystem=xdg-data/flatpak/exports:ro" - ], - "cleanup" : [ - "/include", - "/lib/pkgconfig", - "/man", - "/share/doc", - "/share/gtk-doc", - "/share/man", - "/share/pkgconfig", - "*.la", - "*.a" - ], - "modules" : [ + "id": "page.kramo.Cartridges.Devel", + "runtime": "org.gnome.Platform", + "runtime-version": "47", + "sdk": "org.gnome.Sdk", + "command": "cartridges", + "finish-args": [ + "--share=network", + "--share=ipc", + "--socket=fallback-x11", + "--device=dri", + "--socket=wayland", + "--talk-name=org.freedesktop.Flatpak", + "--filesystem=host", + "--filesystem=~/.var/app/com.valvesoftware.Steam/data/Steam/:ro", + "--filesystem=~/.var/app/net.lutris.Lutris/:ro", + "--filesystem=~/.var/app/com.heroicgameslauncher.hgl/config/heroic/:ro", + "--filesystem=~/.var/app/com.heroicgameslauncher.hgl/config/legendary/:ro", + "--filesystem=~/.var/app/com.usebottles.bottles/data/bottles/:ro", + "--filesystem=~/.var/app/io.itch.itch/config/itch/:ro", + "--filesystem=~/.var/app/org.libretro.RetroArch/config/retroarch/:ro", + "--filesystem=/var/lib/flatpak/app:ro", + "--filesystem=/var/lib/flatpak/exports:ro", + "--filesystem=xdg-data/flatpak/app:ro", + "--filesystem=xdg-data/flatpak/exports:ro" + ], + "cleanup": [ + "/include", + "/lib/pkgconfig", + "/man", + "/share/doc", + "/share/gtk-doc", + "/share/man", + "/share/pkgconfig", + "*.la", + "*.a" + ], + "modules": [ + { + "name": "python3-modules", + "buildsystem": "simple", + "build-commands": [], + "modules": [ { - "name": "python3-modules", - "buildsystem": "simple", - "build-commands": [], - "modules": [ - { - "name": "python3-pyyaml", - "buildsystem": "simple", - "build-commands": [ - "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pyyaml\" --no-build-isolation" - ], - "sources": [ - { - "type": "file", - "url": "https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz", - "sha256": "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2" - } - ] - }, - { - "name": "python3-requests", - "buildsystem": "simple", - "build-commands": [ - "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"requests\" --no-build-isolation" - ], - "sources": [ - { - "type": "file", - "url": "https://files.pythonhosted.org/packages/71/4c/3db2b8021bd6f2f0ceb0e088d6b2d49147671f25832fb17970e9b583d742/certifi-2022.12.7-py3-none-any.whl", - "sha256": "4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18" - }, - { - "type": "file", - "url": "https://files.pythonhosted.org/packages/ff/d7/8d757f8bd45be079d76309248845a04f09619a7b17d6dfc8c9ff6433cac2/charset-normalizer-3.1.0.tar.gz", - "sha256": "34e0a2f9c370eb95597aae63bf85eb5e96826d81e3dcf88b8886012906f509b5" - }, - { - "type": "file", - "url": "https://files.pythonhosted.org/packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl", - "sha256": "90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2" - }, - { - "type": "file", - "url": "https://files.pythonhosted.org/packages/d2/f4/274d1dbe96b41cf4e0efb70cbced278ffd61b5c7bb70338b62af94ccb25b/requests-2.28.2-py3-none-any.whl", - "sha256": "64299f4909223da747622c030b781c0d7811e359c37124b4bd368fb8c6518baa" - }, - { - "type": "file", - "url": "https://files.pythonhosted.org/packages/7b/f5/890a0baca17a61c1f92f72b81d3c31523c99bec609e60c292ea55b387ae8/urllib3-1.26.15-py2.py3-none-any.whl", - "sha256": "aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42" - } - ] - }, - { - "name": "python3-pillow", - "buildsystem": "simple", - "build-commands": [ - "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pillow\" --no-build-isolation" - ], - "sources": [ - { - "type": "file", - "url": "https://files.pythonhosted.org/packages/00/d5/4903f310765e0ff2b8e91ffe55031ac6af77d982f0156061e20a4d1a8b2d/Pillow-9.5.0.tar.gz", - "sha256": "bf548479d336726d7a0eceb6e767e179fbde37833ae42794602631a070d630f1" - } - ] - } - ] + "name": "python3-pyyaml", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pyyaml\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz", + "sha256": "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2" + } + ] }, { - "name" : "blueprint-compiler", - "buildsystem" : "meson", - "sources" : [ - { - "type" : "git", - "url" : "https://gitlab.gnome.org/jwestman/blueprint-compiler", - "tag" : "v0.12.0" - } - ], - "cleanup" : [ - "*" - ] + "name": "python3-requests", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"requests\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/71/4c/3db2b8021bd6f2f0ceb0e088d6b2d49147671f25832fb17970e9b583d742/certifi-2022.12.7-py3-none-any.whl", + "sha256": "4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/ff/d7/8d757f8bd45be079d76309248845a04f09619a7b17d6dfc8c9ff6433cac2/charset-normalizer-3.1.0.tar.gz", + "sha256": "34e0a2f9c370eb95597aae63bf85eb5e96826d81e3dcf88b8886012906f509b5" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl", + "sha256": "90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/d2/f4/274d1dbe96b41cf4e0efb70cbced278ffd61b5c7bb70338b62af94ccb25b/requests-2.28.2-py3-none-any.whl", + "sha256": "64299f4909223da747622c030b781c0d7811e359c37124b4bd368fb8c6518baa" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/7b/f5/890a0baca17a61c1f92f72b81d3c31523c99bec609e60c292ea55b387ae8/urllib3-1.26.15-py2.py3-none-any.whl", + "sha256": "aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42" + } + ] }, { - "name" : "cartridges", - "builddir" : true, - "buildsystem" : "meson", - "run-tests" : true, - "config-opts": [ - "-Dprofile=development" - ], - "sources" : [ - { - "type" : "dir", - "path" : "../.." - } - ] + "name": "python3-pillow", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pillow\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/00/d5/4903f310765e0ff2b8e91ffe55031ac6af77d982f0156061e20a4d1a8b2d/Pillow-9.5.0.tar.gz", + "sha256": "bf548479d336726d7a0eceb6e767e179fbde37833ae42794602631a070d630f1" + } + ] + }, + { + "name": "cartridges", + "builddir": true, + "buildsystem": "meson", + "run-tests": true, + "config-opts": ["-Dprofile=development"], + "sources": [ + { + "type": "dir", + "path": "../.." + } + ] } - ] + ] + }, + { + "name": "blueprint-compiler", + "buildsystem": "meson", + "sources": [ + { + "type": "git", + "url": "https://gitlab.gnome.org/jwestman/blueprint-compiler", + "tag": "v0.14.0" + } + ], + "cleanup": ["*"] + }, + { + "name": "cartridges", + "builddir": true, + "buildsystem": "meson", + "run-tests": true, + "config-opts": ["-Dprofile=development"], + "sources": [ + { + "type": "dir", + "path": ".." + } + ] + } + ] } diff --git a/cartridges/details_dialog.py b/cartridges/details_dialog.py index a31837b..a09ea0a 100644 --- a/cartridges/details_dialog.py +++ b/cartridges/details_dialog.py @@ -47,7 +47,7 @@ class DetailsDialog(Adw.Dialog): cover_button_edit: Gtk.Button = Gtk.Template.Child() cover_button_delete_revealer: Gtk.Revealer = Gtk.Template.Child() cover_button_delete: Gtk.Button = Gtk.Template.Child() - spinner: Gtk.Spinner = Gtk.Template.Child() + spinner: Adw.Spinner = Gtk.Template.Child() name: Adw.EntryRow = Gtk.Template.Child() developer: Adw.EntryRow = Gtk.Template.Child() @@ -285,7 +285,7 @@ class DetailsDialog(Adw.Dialog): def toggle_loading(self) -> None: self.apply_button.set_sensitive(not self.apply_button.get_sensitive()) - self.spinner.set_spinning(not self.spinner.get_spinning()) + self.spinner.set_visible(not self.spinner.get_spinning()) self.cover_overlay.set_opacity(not self.cover_overlay.get_opacity()) def set_cover(self, _source: Any, result: Gio.Task, *_args: Any) -> None: diff --git a/cartridges/game.py b/cartridges/game.py index dc48d32..43d4d94 100644 --- a/cartridges/game.py +++ b/cartridges/game.py @@ -157,7 +157,7 @@ class Game(Gtk.Box): loading = self.loading > 0 self.cover.set_opacity(int(not loading)) - self.spinner.set_spinning(loading) + self.spinner.set_visible(loading) def get_cover_path(self) -> Optional[Path]: cover_path = shared.covers_dir / f"{self.game_id}.gif" diff --git a/cartridges/preferences.py b/cartridges/preferences.py index 208caec..3b23521 100644 --- a/cartridges/preferences.py +++ b/cartridges/preferences.py @@ -112,12 +112,11 @@ class CartridgesPreferences(Adw.PreferencesDialog): sgdb_animated_switch: Adw.SwitchRow = Gtk.Template.Child() sgdb_fetch_button: Gtk.Button = Gtk.Template.Child() sgdb_stack: Gtk.Stack = Gtk.Template.Child() - sgdb_spinner: Gtk.Spinner = Gtk.Template.Child() + sgdb_spinner: Adw.Spinner = Gtk.Template.Child() - danger_zone_group: Adw.PreferencesGroup = Gtk.Template.Child() - remove_all_games_list_box: Gtk.ListBox = Gtk.Template.Child() - reset_list_box: Gtk.ListBox = Gtk.Template.Child() - reset_group: Adw.PreferencesGroup = Gtk.Template.Child() + danger_zone_group = Gtk.Template.Child() + remove_all_games_button_row = Gtk.Template.Child() + reset_button_row = Gtk.Template.Child() removed_games: set[Game] = set() warning_menu_buttons: dict = {} @@ -147,12 +146,12 @@ class CartridgesPreferences(Adw.PreferencesDialog): self.add_controller(shortcut_controller) # General - self.remove_all_games_list_box.connect("row-activated", self.remove_all_games) + self.remove_all_games_button_row.connect("activated", self.remove_all_games) # Debug if shared.PROFILE == "development": - self.reset_group.set_visible(True) - self.reset_list_box.connect("row-activated", self.reset_app) + self.reset_button_row.set_visible(True) + self.reset_button_row.connect("activated", self.reset_app) # Sources settings for source_class in ( @@ -197,7 +196,7 @@ class CartridgesPreferences(Adw.PreferencesDialog): sgdb_manager = shared.store.managers[SgdbManager] sgdb_manager.reset_cancellable() - self.sgdb_spinner.set_spinning(True) + self.sgdb_spinner.set_visible(True) self.sgdb_stack.set_visible_child(self.sgdb_spinner) self.add_toast(download_toast := Adw.Toast.new(_("Downloading covers…"))) @@ -224,7 +223,7 @@ class CartridgesPreferences(Adw.PreferencesDialog): download_toast.dismiss() self.add_toast(toast) - self.sgdb_spinner.set_spinning(False) + self.sgdb_spinner.set_visible(False) self.sgdb_stack.set_visible_child(self.sgdb_fetch_button) for game in shared.store: diff --git a/cartridges/window.py b/cartridges/window.py index 4adebc1..082b3d7 100644 --- a/cartridges/window.py +++ b/cartridges/window.py @@ -60,7 +60,7 @@ class CartridgesWindow(Adw.ApplicationWindow): details_page: Adw.NavigationPage = Gtk.Template.Child() details_view_toolbar_view: Adw.ToolbarView = Gtk.Template.Child() details_view_cover: Gtk.Picture = Gtk.Template.Child() - details_view_spinner: Gtk.Spinner = Gtk.Template.Child() + details_view_spinner: Adw.Spinner = Gtk.Template.Child() details_view_title: Gtk.Label = Gtk.Template.Child() details_view_blurred_cover: Gtk.Picture = Gtk.Template.Child() details_view_play_button: Gtk.Button = Gtk.Template.Child() @@ -351,7 +351,7 @@ class CartridgesWindow(Adw.ApplicationWindow): self.active_game = game self.details_view_cover.set_opacity(int(not game.loading)) - self.details_view_spinner.set_spinning(game.loading) + self.details_view_spinner.set_visible(game.loading) self.details_view_developer.set_label(game.developer or "") self.details_view_developer.set_visible(bool(game.developer)) diff --git a/data/gtk/details-dialog.blp b/data/gtk/details-dialog.blp index a5a5cc8..f99de2d 100644 --- a/data/gtk/details-dialog.blp +++ b/data/gtk/details-dialog.blp @@ -31,9 +31,8 @@ template $DetailsDialog: Adw.Dialog { Overlay { [overlay] - Spinner spinner { - margin-start: 72; - margin-end: 72; + Adw.Spinner spinner { + visible: false; } Overlay cover_overlay { diff --git a/data/gtk/game.blp b/data/gtk/game.blp index 204fb63..8aa2375 100644 --- a/data/gtk/game.blp +++ b/data/gtk/game.blp @@ -64,9 +64,8 @@ template $Game: Box { Overlay { [overlay] - Spinner spinner { - margin-start: 72; - margin-end: 72; + Adw.Spinner spinner { + visible: false; } Picture cover { diff --git a/data/gtk/preferences.blp b/data/gtk/preferences.blp index b604515..ebc8309 100644 --- a/data/gtk/preferences.blp +++ b/data/gtk/preferences.blp @@ -33,76 +33,21 @@ template $CartridgesPreferences: Adw.PreferencesDialog { Adw.PreferencesGroup danger_zone_group { title: _("Danger Zone"); + separate-rows: true; - ListBox remove_all_games_list_box { - Adw.PreferencesRow { - activatable: true; - selectable: false; - - Box { - spacing: 6; - valign: center; - halign: center; - - Label { - label: _("Remove All Games"); - ellipsize: end; - - styles [ - "heading", - ] - } - - styles [ - "header", - ] - } - - styles [ - "error", - ] - } + Adw.ButtonRow remove_all_games_button_row { + title: _("Remove All Games"); styles [ - "boxed-list", + "destructive-action" ] } - } - Adw.PreferencesGroup reset_group { - visible: false; - - ListBox reset_list_box { - Adw.PreferencesRow { - activatable: true; - selectable: false; - - Box { - spacing: 6; - valign: center; - halign: center; - - Label { - label: "Reset App"; - ellipsize: end; - - styles [ - "heading", - ] - } - - styles [ - "header", - ] - } - - styles [ - "error", - ] - } + Adw.ButtonRow reset_button_row { + title: _("Reset App"); styles [ - "boxed-list", + "destructive-action" ] } } @@ -123,6 +68,7 @@ template $CartridgesPreferences: Adw.PreferencesDialog { Adw.PreferencesGroup sources_group { title: _("Sources"); + separate-rows: true; Adw.ExpanderRow steam_expander_row { title: _("Steam"); @@ -440,7 +386,8 @@ template $CartridgesPreferences: Adw.PreferencesDialog { valign: center; } - Spinner sgdb_spinner { + Adw.Spinner sgdb_spinner { + visible: false; valign: center; } } diff --git a/data/gtk/style-dark.css b/data/gtk/style-dark.css index 1599f68..4555311 100644 --- a/data/gtk/style-dark.css +++ b/data/gtk/style-dark.css @@ -1,5 +1,7 @@ -@define-color accent_color @purple_1; -@define-color accent_bg_color @purple_4; +:root { + --accent-color: var(--purple-1); + --accent-bg-color: var(--purple-4); +} #details_view { background-color: black; @@ -8,4 +10,4 @@ #details_view_play_button { color: rgba(0, 0, 0, .8); background-color: white; -} \ No newline at end of file +} diff --git a/data/gtk/style.css b/data/gtk/style.css index 068c539..28498ef 100644 --- a/data/gtk/style.css +++ b/data/gtk/style.css @@ -1,5 +1,7 @@ -@define-color accent_color @purple_5; -@define-color accent_bg_color @purple_3; +:root { + --accent-color: var(--purple-5); + --accent-bg-color: var(--purple-3); +} #details_view { background-color: white; @@ -8,4 +10,4 @@ #details_view_play_button { color: white; background-color: rgba(0, 0, 0, .8); -} \ No newline at end of file +} diff --git a/data/gtk/window.blp b/data/gtk/window.blp index 47b66cd..93cc02b 100644 --- a/data/gtk/window.blp +++ b/data/gtk/window.blp @@ -341,9 +341,8 @@ Adw.NavigationPage details_page { Overlay { [overlay] - Spinner details_view_spinner { - margin-start: 72; - margin-end: 72; + Adw.Spinner details_view_spinner { + visible: false; } Picture details_view_cover { diff --git a/subprojects/blueprint-compiler.wrap b/subprojects/blueprint-compiler.wrap index 25ef549..3af506d 100644 --- a/subprojects/blueprint-compiler.wrap +++ b/subprojects/blueprint-compiler.wrap @@ -1,7 +1,7 @@ [wrap-git] directory = blueprint-compiler url = https://gitlab.gnome.org/jwestman/blueprint-compiler.git -revision = v0.12.0 +revision = v0.14.0 depth = 1 [provide]