File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
sdk/python/packages/flet-core/src/flet_core Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -149,9 +149,21 @@ def _before_build_command(self):
149149 if self .__style is None :
150150 self .__style = ButtonStyle ()
151151 if self .__style .color != self .__color or self .disabled :
152- self .__style .color = self .__color if not self .disabled else None
152+ # if the color is set through the style, use it
153+ if not (
154+ self .__class__ .__name__ in ["FilledButton" , "FilledTonalButton" ]
155+ and self .__style .color
156+ and not self .disabled
157+ ):
158+ self .__style .color = self .__color if not self .disabled else None
153159 if self .__style .bgcolor != self .__bgcolor or self .disabled :
154- self .__style .bgcolor = self .__bgcolor if not self .disabled else None
160+ # if the bgcolor is set through the style, use it
161+ if not (
162+ self .__class__ .__name__ in ["FilledButton" , "FilledTonalButton" ]
163+ and self .__style .bgcolor
164+ and not self .disabled
165+ ):
166+ self .__style .bgcolor = self .__bgcolor if not self .disabled else None
155167 if self .__style .elevation != self .__elevation :
156168 self .__style .elevation = self .__elevation
157169 if self .__style is not None :
You can’t perform that action at this time.
0 commit comments