mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 00:03:45 +08:00
@@ -179,6 +179,7 @@ class Button(Widget):
|
||||
text_padding: int = 20,
|
||||
enabled: bool = True,
|
||||
icon = None,
|
||||
multi_touch: bool = False,
|
||||
):
|
||||
|
||||
super().__init__()
|
||||
@@ -195,6 +196,7 @@ class Button(Widget):
|
||||
self._text_padding = text_padding
|
||||
self._text_size = measure_text_cached(gui_app.font(self._font_weight), self._text, self._font_size)
|
||||
self._icon = icon
|
||||
self._multi_touch = multi_touch
|
||||
self.enabled = enabled
|
||||
|
||||
def set_text(self, text):
|
||||
@@ -208,7 +210,7 @@ class Button(Widget):
|
||||
def _update_state(self):
|
||||
if self.enabled:
|
||||
self._text_color = BUTTON_TEXT_COLOR[self._button_style]
|
||||
if self._is_pressed:
|
||||
if self.is_pressed:
|
||||
self._background_color = BUTTON_PRESSED_BACKGROUND_COLORS[self._button_style]
|
||||
else:
|
||||
self._background_color = BUTTON_BACKGROUND_COLORS[self._button_style]
|
||||
|
||||
Reference in New Issue
Block a user