Open LeafShi1 opened 2 weeks ago
Attention: Patch coverage is 9.37500%
with 29 lines
in your changes missing coverage. Please review.
Project coverage is 74.46985%. Comparing base (
fc56416
) to head (86889e0
). Report is 42 commits behind head on main.
This link - https://devdiv.visualstudio.com/DevDiv/_queries/edit/2053861/?queryId=7c94b3b5-6b84-4f3d-9f76-ff1a7a7b7581 does not work, please fix it.
Had you tested this change at different themes and RtL applications?
The change looks reasonable.
This link - https://devdiv.visualstudio.com/DevDiv/_queries/edit/2053861/?queryId=7c94b3b5-6b84-4f3d-9f76-ff1a7a7b7581 does not work, please fix it.
Had you tested this change at different themes and RtL applications?
The change looks reasonable.
Updated the link of the description and test in different environment
Test in RTL app:
Test in different theme:
Test in Flat Style:
There are still a flickering in Flat Style, and this flickering issue can be resolved by remove https://github.com/dotnet/winforms/blob/889fca6df2aa684e3557ef7737b443ed3af32455/src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs#L3880
But I am not sure if we can remove this directly, @Tanya-Solyanik What do you think?
@LeafShi1 - How do the high contrast themes look before your changes, did it get better or worse with the fix? FYI @merriemcgaw
Before the modification, the Popup state was not obvious, and only a black border was displayed when the mouse entered the control
This is definitely not worse from my perspective. @Tanya-Solyanik?
This is definitely not worse from my perspective. @Tanya-Solyanik?
The new behavior looks more intentional, i.e. we are adding a border when mouse is hovering. I don't mind taking this fix.
@Olina-Zhang - could you please test this fix?
@LeafShi1
But I am not sure if we can remove this directly, @Tanya-Solyanik What do you think?
No, we shouldn't do that. I agree. To fix that we would have to redesign the control look, maybe add a prominent border in the state when the mouse is not above the control
@LeafShi1
But I am not sure if we can remove this directly, @Tanya-Solyanik What do you think?
No, we shouldn't do that. I agree. To fix that we would have to redesign the control look, maybe add a prominent border in the state when the mouse is not above the control
@Tanya-Solyanik Do we need to redesign the controls appearance now?
Before drawing Flat, the combobox control is as follows.
Pic1:
The method of drawing Flat is to draw Outboder and innerBorder. The result after drawing is as follows
Pic2:
When the cursor enters, it is necessary to complete the drawing from Pic1 to Pic2,the actual cause of the flickering is the use of g.DrawRectangle four times in a row when drawing the Flat type. So adding a protruding border when the mouse is not over the control does not seem to solve the flickering problem
Fixes #2053861
Proposed changes
DrawPopUpCombo
fromDrawFlatCombo
method,draw the outer black border only when the ComboBox mouse is overCustomer Impact
Regression?
Risk
Screenshots
Before
Combo box flashes when you move the mouse over it![BeforeChange](https://github.com/dotnet/winforms/assets/132890443/8ea275c8-bf51-46a5-8091-c167aa0dd4be)
After
Combo boxes no longer flicker when you move the mouse over them![AfterChange](https://github.com/dotnet/winforms/assets/132890443/7c81c9de-9231-41ed-bdb6-8eec70e45cae)
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow