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
Fix tab control flickering in dark theme #9049
Fix tab control flickering in dark theme #9049
Conversation
var outerRect = GetOuterTabRect(index); | ||
_graphics.FillRectangle(GetBackgroundBrush(index), outerRect); | ||
|
||
var points = new List<Point>(4); |
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.
stackalloc Point[4]
?
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.
related, nit pick (generic)
We have used explicit types and C#9 new()
https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9#fit-and-finish-features
List<Point> points = new(4);
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.
stackalloc Point[4]
can't do, the actual size is 2-4 depending on index
List<Point> points = new(4);
ok
/cc: @mdonatas |
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.
+1
Run fine with 150%, 200% (no restart though). I do not really see the problem also without this change though.
I normally only use 100% myself, so I do not encounter these issues in normal usage.
I tried to look at border values etc for a few situations, looked fine to me.
@mdonatas Looks to me the visual artifact happens with "Use system default visual style" flag enabled. With that flag it's the system drawing the tab control, our (my) code has nothing to do with this.
Also, I cannot reproduce it. Tried with 150%, 175% DPI, there was no gray 1px line below tabs. Probably it requires 200% DPI, which Windows display settings does not allow me to choose. 175% DPI, "Use system default visual style" flag off. No grey 1x line below tabs. |
Hmm... ok, so there is something related to this Also same here with 175% DPI, couldn't reproduce this underline. |
Right, and it matches what current behavior does. When user selects "default" theme from the list, "Use system defined visual style" checkbox is disabled, controls are rendered by operating system. If OS is dark, GE is dark and vice versa. With non-default theme "Use system defined visual style" is unchecked and becomes editable. This is because we need to render colors different from current OS theme. |
Oh, sorry, I didn't notice that. Can you reproduce |
I suggest this is merged as is both in master and 3.5 and further discussions are handled separately. |
I plan to look at this tomorrow. If I can't fix it tomorrow, i'll do as @gerhardol suggests, merge this and separate the remnant to another issue. |
👍
|
@mdonatas what you said turns right, it was enough to make console tab render the same background color, to get rid of the artifact. |
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.
Thank you
Squash and merge
Great! Thanks @NikolayXHD |
Fixes
tab control flickering introduced by #8815
screenshot
Proposed change
as discussed #8841 (comment)
Screenshots
Test methodology
manually
Test environment(s)
✒️ I contribute this code under The Developer Certificate of Origin.