Skip to content

Commit

Permalink
Port to Libadwaita 1.6 widgets
Browse files Browse the repository at this point in the history
Co-authored-by: kramo <[email protected]>
  • Loading branch information
jamiethecat and kra-mo committed May 1, 2024
1 parent e8db732 commit f7f5cee
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 69 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions cartridges/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -144,12 +143,12 @@ def __init__(self, **kwargs: Any) -> None:
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 (
Expand Down
70 changes: 8 additions & 62 deletions data/gtk/preferences.blp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
Expand All @@ -123,6 +68,7 @@ template $CartridgesPreferences: Adw.PreferencesDialog {

Adw.PreferencesGroup sources_group {
title: _("Sources");
separate-rows: true;

Adw.ExpanderRow steam_expander_row {
title: _("Steam");
Expand Down
2 changes: 1 addition & 1 deletion flatpak/page.kramo.Cartridges.Devel.json
Original file line number Diff line number Diff line change
@@ -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" : [
Expand Down

0 comments on commit f7f5cee

Please sign in to comment.