Skip to content

Commit e175c7f

Browse files
authored
fixed bgcolor, color and elevation (#4126)
1 parent fae728e commit e175c7f

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

sdk/python/packages/flet-core/src/flet_core/elevated_button.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
from flet_core.tooltip import TooltipValue
1010
from flet_core.types import (
1111
AnimationValue,
12+
ClipBehavior,
1213
OffsetValue,
14+
OptionalControlEventCallable,
1315
ResponsiveNumber,
1416
RotateValue,
1517
ScaleValue,
16-
ClipBehavior,
1718
UrlTarget,
18-
OptionalControlEventCallable,
1919
)
2020
from flet_core.utils import deprecated
2121

@@ -160,19 +160,14 @@ def before_update(self):
160160
if any([self.__color, self.__bgcolor, self.__elevation]):
161161
self.__style = self.__style or ButtonStyle()
162162
if self.__style:
163-
self.__style.color = (
164-
self.__style.color if self.__style.color is not None else self.color
165-
)
166-
self.__style.bgcolor = (
167-
self.__style.bgcolor
168-
if self.__style.bgcolor is not None
169-
else self.bgcolor
170-
)
171-
self.__style.elevation = (
172-
self.__style.elevation
173-
if self.__style.elevation is not None
174-
else self.elevation
175-
)
163+
if self.__color is not None:
164+
self.__style.color = self.__color
165+
166+
if self.__bgcolor is not None:
167+
self.__style.bgcolor = self.__bgcolor
168+
169+
if self.__elevation is not None:
170+
self.__style.elevation = self.__elevation
176171
self.__style.side = self._wrap_attr_dict(self.__style.side)
177172
self.__style.shape = self._wrap_attr_dict(self.__style.shape)
178173
self.__style.padding = self._wrap_attr_dict(self.__style.padding)

0 commit comments

Comments
 (0)