Skip to content

Commit

Permalink
property
Browse files Browse the repository at this point in the history
  • Loading branch information
shenjackyuanjie committed Jul 26, 2024
1 parent 7b1b920 commit 114f3c6
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions Difficult_Rocket/gui/widget/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ def _create_vertex_list(self) -> None:
self._num_verts,
self._draw_mode,
groups,
self._batch, # pyright: ignore reportArgumentType
self._group, # pyright: ignore reportArgumentType
self._batch, # pyright: ignore reportArgumentType
self._group, # pyright: ignore reportArgumentType
position=("f", self._get_vertices()),
colors=("Bn", self._rgba * self._num_verts),
translation=("f", (self._x, self._y) * self._num_verts),
Expand All @@ -146,6 +146,34 @@ def thick1(self) -> float:
def thick2(self) -> float:
return self.thick2

@property
def width(self) -> float:
return self._width

@property
def height(self) -> float:
return self.height

@thick1.setter
def thick1(self, value: float):
self._thick1 = value
self._update_vertices()

@thick2.setter
def thick2(self, value: float):
self._thick2 = value
self._update_vertices()

@width.setter
def width(self, value: float):
self._width = value
self._update_vertices()

@height.setter
def height(self, value: float):
self._height = value
self._update_vertices()


class BaseButtonTheme:
"""
Expand Down

0 comments on commit 114f3c6

Please sign in to comment.