From 20651df307c9cfc059ebe48b56d78cd21fd3cfcf Mon Sep 17 00:00:00 2001 From: Silvris <58583688+Silvris@users.noreply.github.com> Date: Sat, 19 Apr 2025 18:21:11 -0500 Subject: [PATCH] kvui: fix kwargs on ResizableTextField and ImageButton (#4903) --- kvui.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kvui.py b/kvui.py index 9a8b7109..d0d965c3 100644 --- a/kvui.py +++ b/kvui.py @@ -98,7 +98,7 @@ class ThemedApp(MDApp): class ImageIcon(MDButtonIcon, AsyncImage): def __init__(self, *args, **kwargs): - super().__init__(args, kwargs) + super().__init__(*args, **kwargs) self.image = ApAsyncImage(**kwargs) self.add_widget(self.image) @@ -183,15 +183,17 @@ class ResizableTextField(MDTextField): height_rule = subclass.properties.get("height", None) if height_rule: height_rule.ignore_prev = True - super().__init__(args, kwargs) + super().__init__(*args, **kwargs) def on_release(self: MDButton, *args): super(MDButton, self).on_release(args) self.on_leave() + MDButton.on_release = on_release + # I was surprised to find this didn't already exist in kivy :( class HoverBehavior(object): """originally from https://stackoverflow.com/a/605348110""" @@ -904,7 +906,7 @@ class GameManager(ThemedApp): pos_hint={"center_y": 0.575}) info_button.bind(on_release=self.command_button_action) bottom_layout.add_widget(info_button) - self.textinput = CommandPromptTextInput(size_hint_y=None, height=dp(30), multiline=False, write_tab=False) + self.textinput = CommandPromptTextInput(size_hint_y=None, multiline=False, write_tab=False) self.textinput.bind(on_text_validate=self.on_message) info_button.height = self.textinput.height self.textinput.text_validate_unfocus = False