Skip to content

Commit

Permalink
update style setting (#2435)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndonkoHenri committed Jan 20, 2024
1 parent 0c45658 commit 5257897
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions sdk/python/packages/flet-core/src/flet_core/elevated_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,21 @@ def _before_build_command(self):
if self.__style is None:
self.__style = ButtonStyle()
if self.__style.color != self.__color or self.disabled:
self.__style.color = self.__color if not self.disabled else None
# if the color is set through the style, use it
if not (
self.__class__.__name__ in ["FilledButton", "FilledTonalButton"]
and self.__style.color
and not self.disabled
):
self.__style.color = self.__color if not self.disabled else None
if self.__style.bgcolor != self.__bgcolor or self.disabled:
self.__style.bgcolor = self.__bgcolor if not self.disabled else None
# if the bgcolor is set through the style, use it
if not (
self.__class__.__name__ in ["FilledButton", "FilledTonalButton"]
and self.__style.bgcolor
and not self.disabled
):
self.__style.bgcolor = self.__bgcolor if not self.disabled else None
if self.__style.elevation != self.__elevation:
self.__style.elevation = self.__elevation
if self.__style is not None:
Expand Down

0 comments on commit 5257897

Please sign in to comment.