-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix the Button border and color with FlatStyle = Flat: FlatAppearance properties #13898
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
base: main
Are you sure you want to change the base?
Fix the Button border and color with FlatStyle = Flat: FlatAppearance properties #13898
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13898 +/- ##
===================================================
- Coverage 77.15021% 77.14583% -0.00438%
===================================================
Files 3274 3274
Lines 645043 645064 +21
Branches 47701 47705 +4
===================================================
- Hits 497652 497640 -12
- Misses 143717 143742 +25
- Partials 3674 3682 +8
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR fixes button border and color issues for buttons with FlatStyle = Flat by implementing proper support for FlatAppearance properties in dark mode. The changes ensure that MouseDownBackColor, MouseOverBackColor, BorderSize, and BorderColor properties are respected when rendering flat buttons in dark mode.
Key changes:
- Extended button renderer interfaces and implementations to support border size and color parameters
- Added logic to respect FlatAppearance MouseDownBackColor and MouseOverBackColor properties
- Updated all dark mode button renderers to handle the new border parameters
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
ButtonDarkModeAdapter.cs | Added logic to use FlatAppearance MouseDownBackColor and MouseOverBackColor, and pass BorderSize/BorderColor to renderers |
IButtonRenderer.cs | Extended interface to include borderSize and borderColor parameters in method signatures |
ButtonDarkModeRendererBase.cs | Updated base class to support new border parameters and added virtual DrawButtonBorder method |
FlatButtonDarkModeRenderer.cs | Implemented proper border handling using FlatAppearance properties and simplified border drawing |
SystemButtonDarkModeRenderer.cs | Updated method signature to match interface changes |
PopupButtonDarkModeRenderer.cs | Updated method signature to match interface changes |
Fixes #13897
Proposed changes
MouseDownBackColor
andMouseOverBackColor
for Flat button in DarkModeborderSize
andborderColor
drawing logic to Flat buttonCustomer Impact
FlatAppearance
property can be set normally in DarkModeRegression?
Risk
Screenshots
Before
FlatAppearance settings are ignored
beforeChange.mp4
After
All of the FlatAppearance properties work well
AfterChanges.mp4
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow