Port to Libadwaita 1.6 widgets

Co-authored-by: kramo <contact@kramo.page>
This commit is contained in:
Jamie Gravendeel
2024-05-01 12:05:10 +02:00
parent e8db732868
commit 38f85d2f4a
4 changed files with 16 additions and 69 deletions

View File

@@ -21,6 +21,8 @@ jobs:
with:
bundle: page.kramo.Cartridges.Devel.flatpak
manifest-path: flatpak/page.kramo.Cartridges.Devel.json
repository-url: https://nightly.gnome.org/gnome-nightly.flatpakrepo
repository-name: gnome-nightly
windows:
name: Windows

View File

@@ -112,9 +112,8 @@ class CartridgesPreferences(Adw.PreferencesDialog):
sgdb_spinner = Gtk.Template.Child()
danger_zone_group = Gtk.Template.Child()
remove_all_games_list_box = Gtk.Template.Child()
reset_list_box = Gtk.Template.Child()
reset_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 = {}
@@ -144,12 +143,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 (

View File

@@ -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");

View File

@@ -1,7 +1,7 @@
{
"id" : "page.kramo.Cartridges.Devel",
"runtime" : "org.gnome.Platform",
"runtime-version" : "46",
"runtime-version" : "master",
"sdk" : "org.gnome.Sdk",
"command" : "cartridges",
"finish-args" : [