Remove unnecesseray double UIAnchorLayout with controller support and setting of controller events on window

This commit is contained in:
csd4ni3l
2025-06-25 09:54:19 +02:00
parent ffcf12552a
commit 1780ab7e8d
5 changed files with 14 additions and 23 deletions

View File

@@ -7,8 +7,7 @@ class Main(arcade.gui.UIView):
def __init__(self, pypresence_client=None):
super().__init__()
self.root = self.add_widget(UIFocusGroup())
self.anchor = self.root.add(arcade.gui.UIAnchorLayout())
self.anchor = self.add_widget(UIFocusGroup(size_hint=(1, 1)))
self.box = self.anchor.add(arcade.gui.UIBoxLayout(space_between=10), anchor_x='center', anchor_y='center')
self.pypresence_client = pypresence_client
@@ -59,7 +58,7 @@ class Main(arcade.gui.UIView):
self.settings_button = self.box.add(arcade.gui.UITextureButton(text="Settings", texture=button_texture, texture_hovered=button_hovered_texture, width=self.window.width / 2, height=150, style=big_button_style))
self.settings_button.on_click = lambda event: self.settings()
self.root.detect_focusable_widgets()
self.anchor.detect_focusable_widgets()
def play(self):
from menus.fractal_chooser import FractalChooser