-
Notifications
You must be signed in to change notification settings - Fork 512
fix: ensure ElevatedButton
Properties (bgcolor, color, elevation) are correctly updated
#4126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's Guide by SourceryThis pull request fixes a bug in the ElevatedButton class where the bgcolor, color, and elevation properties were not being properly updated after the initial setting. The changes ensure that these properties override the corresponding values in the button's style when explicitly set. Updated class diagram for ElevatedButtonclassDiagram
class ElevatedButton {
- __color
- __bgcolor
- __elevation
- __style
+ before_update()
}
class ButtonStyle {
+ color
+ bgcolor
+ elevation
+ side
+ shape
+ padding
}
ElevatedButton --> ButtonStyle
ElevatedButton : +before_update()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @InesaFitsner - I've reviewed your changes - here's some feedback:
Overall Comments:
- Thank you for this fix. Please remember to update the documentation as mentioned in your checklist to reflect that bgcolor, color, and elevation properties override the corresponding properties in button.style.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
if self.__style.elevation is not None | ||
else self.elevation | ||
) | ||
if self.__color is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (code-quality): Extract code out into method (extract-method
)
This comment was marked as resolved.
This comment was marked as resolved.
ElevatedButton
Properties (bgcolor, color, elevation) are correctly updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
* main: (31 commits) Migrate `colors` and `icons` variables to Enums (flet-dev#4180) feat: expose more properties in Controls (flet-dev#4105) feat!: Refactor `Badge` Control to a Dataclass; create new `Control.badge` property (flet-dev#4077) fix: clicking on `CupertinoContextMenuAction` doesn't close context menu (flet-dev#3948) fix dropdown `max_menu_height` (flet-dev#3974) Fix undefined name "Future" --> asyncio.Future (flet-dev#4230) wrap ListTile in material widget (flet-dev#4206) Update CONTRIBUTING.md (flet-dev#4208) TextField: suffix_icon, prefix_icon and icon can be Control or str (flet-dev#4173) feat!: enhance `Map` control (flet-dev#3994) skip running flutter doctor on windows if no_rich_output is True (flet-dev#4108) add --pyinstaller-build-args to pack cli command (flet-dev#4187) fix/feat: make `SearchBar`'s view height adjustable; add new properties (flet-dev#4039) fix: prevent button `style` from being modified in `before_update()` (flet-dev#4181) fix: disabling filled buttons is not visually respected (flet-dev#4090) when `label` is set, use `MainAxisSize.min` for the `Row` (flet-dev#3998) fix: `NavigationBarDestination.disabled` has no visual effect (flet-dev#4073) fix autofill in CupertinoTextField (flet-dev#4103) Linechart: jsonDecode tooltip before displaying (flet-dev#4069) fixed bgcolor, color and elevation (flet-dev#4126) ...
Description
The issue was that bgcolor, color and elevation were were not updated (only updated for the first time).
Fixes #4119
Test Code
Type of change
Checklist:
Screenshots (if applicable):
Additional details
Summary by Sourcery
Fix the update mechanism for bgcolor, color, and elevation properties in the ElevatedButton component to ensure they are correctly applied after the initial setting. Update documentation to reflect the behavior of these properties.
Bug Fixes:
Documentation: