From 66835a006db86bdfd1306a0c81d2a00945d7a21a Mon Sep 17 00:00:00 2001 From: Hari Rana Date: Thu, 2 Jan 2025 10:26:29 -0500 Subject: [PATCH] new-bottle-dialog: Rearrange elements The headings were removed, as there is no reason to keep cluttering the UI with unnecessary text. The Runner and bottle directory options are now available in every environment. Closes https://github.com/bottlesdevs/Bottles/issues/3036 --- bottles/frontend/ui/new-bottle-dialog.blp | 43 ++++++++++----------- bottles/frontend/views/new_bottle_dialog.py | 5 +-- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/bottles/frontend/ui/new-bottle-dialog.blp b/bottles/frontend/ui/new-bottle-dialog.blp index 6076aafd136..7f0414f6aef 100644 --- a/bottles/frontend/ui/new-bottle-dialog.blp +++ b/bottles/frontend/ui/new-bottle-dialog.blp @@ -59,8 +59,6 @@ template $BottlesNewBottleDialog: Adw.Dialog { } Adw.PreferencesGroup { - title: _("Environment"); - ListBox environment_list_box { selection-mode: none; @@ -98,8 +96,13 @@ template $BottlesNewBottleDialog: Adw.Dialog { } Adw.PreferencesGroup { - title: _("Custom"); - sensitive: bind custom.active; + Adw.ComboRow combo_arch { + title: _("Architecture"); + subtitle: _("32-bit should only be used if strictly necessary."); + visible: bind custom.active; + + model: StringList str_list_arch {}; + } Adw.ComboRow combo_runner { title: _("Runner"); @@ -108,19 +111,12 @@ template $BottlesNewBottleDialog: Adw.Dialog { model: StringList str_list_runner {}; } - Adw.ComboRow combo_arch { - title: _("Architecture"); - subtitle: _("32-bit should only be used if strictly necessary."); - - model: StringList str_list_arch {}; - } - Adw.ActionRow { - title: _("Configuration"); - subtitle: _("Import a custom configuration."); - activatable-widget: btn_choose_env; + title: _("Bottle Directory"); + subtitle: _("Directory that will contain the data of this bottle."); + activatable-widget: btn_choose_path; - Button btn_choose_env_reset { + Button btn_choose_path_reset { tooltip-text: _("Reset to Default"); valign: center; visible: false; @@ -131,7 +127,7 @@ template $BottlesNewBottleDialog: Adw.Dialog { ] } - Button btn_choose_env { + Button btn_choose_path { valign: center; child: Box { @@ -141,17 +137,18 @@ template $BottlesNewBottleDialog: Adw.Dialog { icon-name: "document-open-symbolic"; } - Label label_choose_env {} + Label label_choose_path {} }; } } Adw.ActionRow { - title: _("Bottle Directory"); - subtitle: _("Directory that will contain the data of this bottle."); - activatable-widget: btn_choose_path; + title: _("Configuration"); + subtitle: _("Import a custom configuration."); + activatable-widget: btn_choose_env; + visible: bind custom.active; - Button btn_choose_path_reset { + Button btn_choose_env_reset { tooltip-text: _("Reset to Default"); valign: center; visible: false; @@ -162,7 +159,7 @@ template $BottlesNewBottleDialog: Adw.Dialog { ] } - Button btn_choose_path { + Button btn_choose_env { valign: center; child: Box { @@ -172,7 +169,7 @@ template $BottlesNewBottleDialog: Adw.Dialog { icon-name: "document-open-symbolic"; } - Label label_choose_path {} + Label label_choose_env {} }; } } diff --git a/bottles/frontend/views/new_bottle_dialog.py b/bottles/frontend/views/new_bottle_dialog.py index 35ea3a33e73..cff2ea7c874 100644 --- a/bottles/frontend/views/new_bottle_dialog.py +++ b/bottles/frontend/views/new_bottle_dialog.py @@ -193,10 +193,7 @@ def create_bottle(self, *_args: Any) -> None: self.set_can_close(False) self.stack_create.set_visible_child_name("page_creating") - if self.selected_environment == "active": - self.runner = self.manager.runners_available[ - self.combo_runner.get_selected() - ] + self.runner = self.manager.runners_available[self.combo_runner.get_selected()] RunAsync( task_func=self.manager.create_bottle,