Use Adw.ExpanderRows for import sources
This commit is contained in:
@@ -48,116 +48,99 @@ template PreferencesWindow : Adw.PreferencesWindow {
|
|||||||
title: _("Import");
|
title: _("Import");
|
||||||
icon-name: "document-save-symbolic";
|
icon-name: "document-save-symbolic";
|
||||||
|
|
||||||
Adw.PreferencesGroup steam_group {
|
Adw.PreferencesGroup sources_group {
|
||||||
title: _("Steam");
|
title: _("Sources");
|
||||||
|
|
||||||
Adw.ActionRow {
|
Adw.ExpanderRow steam_expander_row {
|
||||||
title: _("Import From Steam");
|
title: _("Steam");
|
||||||
|
show-enable-switch: true;
|
||||||
|
|
||||||
Switch steam_switch {
|
Adw.ActionRow {
|
||||||
|
title: _("Steam Install Location");
|
||||||
|
subtitle: _("Directory to use when importing games");
|
||||||
|
|
||||||
|
Button steam_file_chooser_button {
|
||||||
|
icon-name: "folder-symbolic";
|
||||||
valign: center;
|
valign: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Adw.ActionRow {
|
||||||
|
title: _("Extra Steam Libraries");
|
||||||
|
subtitle: _("Select other directories where you have Steam games installed");
|
||||||
|
|
||||||
|
|
||||||
|
Revealer steam_clear_button_revealer {
|
||||||
|
reveal-child: false;
|
||||||
|
transition-type: slide_left;
|
||||||
|
Button steam_clear_button {
|
||||||
|
label: _("Clear");
|
||||||
|
valign: center;
|
||||||
|
halign: end;
|
||||||
|
|
||||||
|
styles [
|
||||||
|
"destructive-action",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Button steam_extra_file_chooser_button {
|
||||||
|
icon-name: "folder-new-symbolic";
|
||||||
|
valign: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Adw.ActionRow {
|
Adw.ExpanderRow heroic_expander_row {
|
||||||
title: _("Steam Install Location");
|
title: _("Heroic");
|
||||||
subtitle: _("Directory to use when importing games");
|
show-enable-switch: true;
|
||||||
|
|
||||||
Button steam_file_chooser_button {
|
Adw.ActionRow {
|
||||||
icon-name: "folder-symbolic";
|
title: _("Heroic Install Location");
|
||||||
valign: center;
|
subtitle: _("Directory to use when importing games");
|
||||||
}
|
|
||||||
}
|
|
||||||
Adw.ActionRow {
|
|
||||||
title: _("Extra Steam Libraries");
|
|
||||||
subtitle: _("Select other directories where you have Steam games installed");
|
|
||||||
|
|
||||||
|
Button heroic_file_chooser_button {
|
||||||
Revealer steam_clear_button_revealer {
|
icon-name: "folder-symbolic";
|
||||||
reveal-child: false;
|
|
||||||
transition-type: slide_left;
|
|
||||||
Button steam_clear_button {
|
|
||||||
label: _("Clear");
|
|
||||||
valign: center;
|
valign: center;
|
||||||
halign: end;
|
|
||||||
|
|
||||||
styles [
|
|
||||||
"destructive-action",
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button steam_extra_file_chooser_button {
|
Adw.ActionRow {
|
||||||
icon-name: "folder-new-symbolic";
|
title: _("Import Epic Games");
|
||||||
valign: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Adw.PreferencesGroup heroic_group {
|
Switch heroic_epic_switch {
|
||||||
title: _("Heroic");
|
|
||||||
|
|
||||||
Adw.ActionRow {
|
|
||||||
title: _("Import From Heroic");
|
|
||||||
|
|
||||||
Switch heroic_switch {
|
|
||||||
valign: center;
|
valign: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Adw.ActionRow {
|
Adw.ActionRow {
|
||||||
title: _("Heroic Install Location");
|
title: _("Import GOG Games");
|
||||||
subtitle: _("Directory to use when importing games");
|
|
||||||
|
|
||||||
Button heroic_file_chooser_button {
|
Switch heroic_gog_switch {
|
||||||
icon-name: "folder-symbolic";
|
|
||||||
valign: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Adw.ActionRow {
|
|
||||||
title: _("Import Epic Games");
|
|
||||||
|
|
||||||
Switch heroic_epic_switch {
|
|
||||||
valign: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Adw.ActionRow {
|
|
||||||
title: _("Import GOG Games");
|
|
||||||
|
|
||||||
Switch heroic_gog_switch {
|
|
||||||
valign: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Adw.ActionRow {
|
|
||||||
title: _("Import Sideloaded Games");
|
|
||||||
|
|
||||||
Switch heroic_sideloaded_switch {
|
|
||||||
valign: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Adw.PreferencesGroup bottles_group {
|
|
||||||
title: _("Bottles");
|
|
||||||
|
|
||||||
Adw.ActionRow {
|
|
||||||
title: _("Import From Bottles");
|
|
||||||
|
|
||||||
Switch bottles_switch {
|
|
||||||
valign: center;
|
valign: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Adw.ActionRow {
|
||||||
|
title: _("Import Sideloaded Games");
|
||||||
|
|
||||||
|
Switch heroic_sideloaded_switch {
|
||||||
|
valign: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Adw.ActionRow {
|
Adw.ExpanderRow bottles_expander_row {
|
||||||
title: _("Bottles Install Location");
|
title: _("Bottles");
|
||||||
subtitle: _("Directory to use when importing games");
|
show-enable-switch: true;
|
||||||
|
|
||||||
Button bottles_file_chooser_button {
|
Adw.ActionRow {
|
||||||
icon-name: "folder-symbolic";
|
title: _("Bottles Install Location");
|
||||||
valign: center;
|
subtitle: _("Directory to use when importing games");
|
||||||
|
|
||||||
|
Button bottles_file_chooser_button {
|
||||||
|
icon-name: "folder-symbolic";
|
||||||
|
valign: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,24 +29,25 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
|||||||
general_page = Gtk.Template.Child()
|
general_page = Gtk.Template.Child()
|
||||||
import_page = Gtk.Template.Child()
|
import_page = Gtk.Template.Child()
|
||||||
|
|
||||||
|
sources_group = Gtk.Template.Child()
|
||||||
|
|
||||||
exit_after_launch_switch = Gtk.Template.Child()
|
exit_after_launch_switch = Gtk.Template.Child()
|
||||||
cover_launches_game_switch = Gtk.Template.Child()
|
cover_launches_game_switch = Gtk.Template.Child()
|
||||||
high_quality_images_switch = Gtk.Template.Child()
|
high_quality_images_switch = Gtk.Template.Child()
|
||||||
|
|
||||||
steam_switch = Gtk.Template.Child()
|
steam_expander_row = Gtk.Template.Child()
|
||||||
steam_file_chooser_button = Gtk.Template.Child()
|
steam_file_chooser_button = Gtk.Template.Child()
|
||||||
steam_extra_file_chooser_button = Gtk.Template.Child()
|
steam_extra_file_chooser_button = Gtk.Template.Child()
|
||||||
steam_clear_button_revealer = Gtk.Template.Child()
|
steam_clear_button_revealer = Gtk.Template.Child()
|
||||||
steam_clear_button = Gtk.Template.Child()
|
steam_clear_button = Gtk.Template.Child()
|
||||||
|
|
||||||
heroic_switch = Gtk.Template.Child()
|
heroic_expander_row = Gtk.Template.Child()
|
||||||
heroic_file_chooser_button = Gtk.Template.Child()
|
heroic_file_chooser_button = Gtk.Template.Child()
|
||||||
heroic_epic_switch = Gtk.Template.Child()
|
heroic_epic_switch = Gtk.Template.Child()
|
||||||
heroic_gog_switch = Gtk.Template.Child()
|
heroic_gog_switch = Gtk.Template.Child()
|
||||||
heroic_sideloaded_switch = Gtk.Template.Child()
|
heroic_sideloaded_switch = Gtk.Template.Child()
|
||||||
|
|
||||||
bottles_group = Gtk.Template.Child()
|
bottles_expander_row = Gtk.Template.Child()
|
||||||
bottles_switch = Gtk.Template.Child()
|
|
||||||
bottles_file_chooser_button = Gtk.Template.Child()
|
bottles_file_chooser_button = Gtk.Template.Child()
|
||||||
|
|
||||||
def __init__(self, parent_widget, **kwargs):
|
def __init__(self, parent_widget, **kwargs):
|
||||||
@@ -74,14 +75,14 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
|||||||
)
|
)
|
||||||
schema.bind(
|
schema.bind(
|
||||||
"steam",
|
"steam",
|
||||||
self.steam_switch,
|
self.steam_expander_row,
|
||||||
"active",
|
"enable-expansion",
|
||||||
Gio.SettingsBindFlags.DEFAULT,
|
Gio.SettingsBindFlags.DEFAULT,
|
||||||
)
|
)
|
||||||
schema.bind(
|
schema.bind(
|
||||||
"heroic",
|
"heroic",
|
||||||
self.heroic_switch,
|
self.heroic_expander_row,
|
||||||
"active",
|
"enable-expansion",
|
||||||
Gio.SettingsBindFlags.DEFAULT,
|
Gio.SettingsBindFlags.DEFAULT,
|
||||||
)
|
)
|
||||||
schema.bind(
|
schema.bind(
|
||||||
@@ -104,8 +105,8 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
|||||||
)
|
)
|
||||||
schema.bind(
|
schema.bind(
|
||||||
"bottles",
|
"bottles",
|
||||||
self.bottles_switch,
|
self.bottles_expander_row,
|
||||||
"active",
|
"enable-expansion",
|
||||||
Gio.SettingsBindFlags.DEFAULT,
|
Gio.SettingsBindFlags.DEFAULT,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -175,4 +176,4 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if os.name == "nt":
|
if os.name == "nt":
|
||||||
self.import_page.remove(self.bottles_group)
|
self.sources_group.remove(self.bottles_expander_row)
|
||||||
|
|||||||
Reference in New Issue
Block a user