Added Back Button

This commit is contained in:
Vishal 2022-07-31 23:57:35 +05:30 committed by GitHub
parent b47a2815dc
commit 62f42f5e49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -268,12 +268,17 @@ class PluginManagerWindow(ba.Window, PluginManager):
stack_offset=(0, -25) if uiscale is ba.UIScale.SMALL else (0, 0) stack_offset=(0, -25) if uiscale is ba.UIScale.SMALL else (0, 0)
) )
# self._back_button = back_button = ba.buttonwidget( self._back_button = back_button = ba.buttonwidget(
# parent=self._root_widget, parent=self._root_widget,
# position=(self._width - 160, self._height - 60), size=(160, 68), position=(53 + (100 if uiscale is ba.UIScale.SMALL else 0), self._height - 60),
# button_type="back", scale=0.75, autoselect=True, text_scale=1.2, size=(60, 60),
# label="Back", on_activate_call=self._back) scale=0.8,
# ba.containerwidget(edit=self._root_widget, cancel_button=back_button) label=ba.charstr(ba.SpecialChar.BACK),
autoselect=True,
button_type='backSmall',
on_activate_call=self._back)
ba.containerwidget(edit=self._root_widget, cancel_button=back_button)
ba.textwidget( ba.textwidget(
parent=self._root_widget, parent=self._root_widget,
@ -369,6 +374,13 @@ class PluginManagerWindow(ba.Window, PluginManager):
# border=2, margin=0) # border=2, margin=0)
# self._mod_selected = None # self._mod_selected = None
# self._refresh() # self._refresh()
def _back(self) -> None:
from bastd.ui.settings.allsettings import AllSettingsWindow
ba.containerwidget(edit=self._root_widget,
transition=self._transition_out)
ba.app.ui.set_main_menu_window(
AllSettingsWindow(transition='in_left').get_root_widget())
async def setup_plugin_categories(self, plugin_index): async def setup_plugin_categories(self, plugin_index):
self.categories["All"] = None self.categories["All"] = None