better?
This commit is contained in:
parent
7f52894682
commit
132c6f09ba
@ -78,7 +78,7 @@ class ButtonTheme(BaseTheme):
|
|||||||
font_theme: Optional[FontTheme] = None,
|
font_theme: Optional[FontTheme] = None,
|
||||||
):
|
):
|
||||||
super().__init__(main_color, secondary_color, main_font)
|
super().__init__(main_color, secondary_color, main_font)
|
||||||
self.font_theme = font_theme or FontTheme(main_color, secondary_color, main_font)
|
self.font_theme = font_theme or FontTheme()
|
||||||
self.hit_color = hit_color
|
self.hit_color = hit_color
|
||||||
|
|
||||||
|
|
||||||
@ -178,10 +178,10 @@ class PressTextButton(widgets.WidgetBase):
|
|||||||
...
|
...
|
||||||
|
|
||||||
def on_press(self, x, y):
|
def on_press(self, x, y):
|
||||||
import random
|
# import random
|
||||||
self.value += "1"
|
self.value += "1"
|
||||||
next_rgb = [random.randint(50, 255) for _ in range(3)]
|
# next_rgb = [random.randint(50, 255) for _ in range(3)]
|
||||||
self.untouched_color = (*next_rgb, 255)
|
# self.untouched_color = (*next_rgb, 255)
|
||||||
|
|
||||||
|
|
||||||
PressTextButton.register_event_type('on_press')
|
PressTextButton.register_event_type('on_press')
|
||||||
|
@ -95,8 +95,7 @@ class SR1ShipRender(BaseScreen):
|
|||||||
x=main_window.width / 2, y=main_window.height / 2)
|
x=main_window.width / 2, y=main_window.height / 2)
|
||||||
self.render_d_label.visible = self.status.draw_d_pos
|
self.render_d_label.visible = self.status.draw_d_pos
|
||||||
|
|
||||||
self.test_button = PressTextButton(x=100, y=100,
|
self.test_button = PressTextButton(x=100, y=100, width=150, height=30, text='test button',
|
||||||
width=150, height=30, text='test button',
|
|
||||||
batch=self.main_batch, group=Group(5, parent=main_window.main_group))
|
batch=self.main_batch, group=Group(5, parent=main_window.main_group))
|
||||||
# self.test_button.push_handlers(main_window)
|
# self.test_button.push_handlers(main_window)
|
||||||
main_window.push_handlers(self.test_button)
|
main_window.push_handlers(self.test_button)
|
||||||
|
Loading…
Reference in New Issue
Block a user