Use Adw.ExpanderRows for import sources
This commit is contained in:
@@ -48,16 +48,12 @@ template PreferencesWindow : Adw.PreferencesWindow {
|
||||
title: _("Import");
|
||||
icon-name: "document-save-symbolic";
|
||||
|
||||
Adw.PreferencesGroup steam_group {
|
||||
Adw.PreferencesGroup sources_group {
|
||||
title: _("Sources");
|
||||
|
||||
Adw.ExpanderRow steam_expander_row {
|
||||
title: _("Steam");
|
||||
|
||||
Adw.ActionRow {
|
||||
title: _("Import From Steam");
|
||||
|
||||
Switch steam_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
show-enable-switch: true;
|
||||
|
||||
Adw.ActionRow {
|
||||
title: _("Steam Install Location");
|
||||
@@ -94,16 +90,9 @@ template PreferencesWindow : Adw.PreferencesWindow {
|
||||
}
|
||||
}
|
||||
|
||||
Adw.PreferencesGroup heroic_group {
|
||||
Adw.ExpanderRow heroic_expander_row {
|
||||
title: _("Heroic");
|
||||
|
||||
Adw.ActionRow {
|
||||
title: _("Import From Heroic");
|
||||
|
||||
Switch heroic_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
show-enable-switch: true;
|
||||
|
||||
Adw.ActionRow {
|
||||
title: _("Heroic Install Location");
|
||||
@@ -140,16 +129,9 @@ template PreferencesWindow : Adw.PreferencesWindow {
|
||||
}
|
||||
}
|
||||
|
||||
Adw.PreferencesGroup bottles_group {
|
||||
Adw.ExpanderRow bottles_expander_row {
|
||||
title: _("Bottles");
|
||||
|
||||
Adw.ActionRow {
|
||||
title: _("Import From Bottles");
|
||||
|
||||
Switch bottles_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
show-enable-switch: true;
|
||||
|
||||
Adw.ActionRow {
|
||||
title: _("Bottles Install Location");
|
||||
@@ -162,4 +144,5 @@ template PreferencesWindow : Adw.PreferencesWindow {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,24 +29,25 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
general_page = Gtk.Template.Child()
|
||||
import_page = Gtk.Template.Child()
|
||||
|
||||
sources_group = Gtk.Template.Child()
|
||||
|
||||
exit_after_launch_switch = Gtk.Template.Child()
|
||||
cover_launches_game_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_extra_file_chooser_button = Gtk.Template.Child()
|
||||
steam_clear_button_revealer = 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_epic_switch = Gtk.Template.Child()
|
||||
heroic_gog_switch = Gtk.Template.Child()
|
||||
heroic_sideloaded_switch = Gtk.Template.Child()
|
||||
|
||||
bottles_group = Gtk.Template.Child()
|
||||
bottles_switch = Gtk.Template.Child()
|
||||
bottles_expander_row = Gtk.Template.Child()
|
||||
bottles_file_chooser_button = Gtk.Template.Child()
|
||||
|
||||
def __init__(self, parent_widget, **kwargs):
|
||||
@@ -74,14 +75,14 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
)
|
||||
schema.bind(
|
||||
"steam",
|
||||
self.steam_switch,
|
||||
"active",
|
||||
self.steam_expander_row,
|
||||
"enable-expansion",
|
||||
Gio.SettingsBindFlags.DEFAULT,
|
||||
)
|
||||
schema.bind(
|
||||
"heroic",
|
||||
self.heroic_switch,
|
||||
"active",
|
||||
self.heroic_expander_row,
|
||||
"enable-expansion",
|
||||
Gio.SettingsBindFlags.DEFAULT,
|
||||
)
|
||||
schema.bind(
|
||||
@@ -104,8 +105,8 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
)
|
||||
schema.bind(
|
||||
"bottles",
|
||||
self.bottles_switch,
|
||||
"active",
|
||||
self.bottles_expander_row,
|
||||
"enable-expansion",
|
||||
Gio.SettingsBindFlags.DEFAULT,
|
||||
)
|
||||
|
||||
@@ -175,4 +176,4 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
)
|
||||
|
||||
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