-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
List, Tree: Make sure sub-pixel antialiasing works across all lists and trees #84715
Comments
This needs to be set as a non-optional tree configuration and needs adoption from every tree user. |
Thanks a lot for pushing on this. |
@joaomoreno These changes actually seem to break the tree selection. |
@isidorn Pushed fix for it. |
I adopted for notifications, however requires more work because notifications use drop shadows. I opened #85043 as follow up. |
✅ |
✅ |
@roblourens I've fixed search and settings. Create this additional one for settings: #85106 |
@alexr00 I've fixed custom views: it was pretty straightforward, just copied the other viewlet views. |
I'm verifying now, I'll create new more targeted issues for any parts that aren't rendering correctly since this issue contains so much |
@joaomoreno says:
TL;DR Are you a list/tree user? You need to provide a background color to the list/tree in order to preserve sub-pixel anti-aliasing in Windows and Linux.
Recent findings by @alexandrudima and @bpasero uncovered that sub-pixel anti-aliasing gets disabled when a layer is transparent. The list/tree automatically creates a new rendering layer for scrolling performance. So, in order to preserve sub-pixel AA, the root DOM element of the layer must have a background color. That background color depends on its placement in the workbench.
Example: the Explorer should just forward the sidebar background color:
vscode/src/vs/workbench/contrib/files/browser/views/explorerView.ts
Line 387 in 90a0eb3
Note: Only opaque colors work here, since passing in a transparent color would defeat the whole purpose and would potentially place the same transparent background color twice, making it darker. If a theme or user eventually passes in a transparent color, the list/tree will ignore it and print the following warning to the devtools:
Note 2: macOS doesn't have sub-pixel AA. This only affects Linux and Windows.
Workbench List/Tree Users
referencesWidget.ts
@jriekenbreadcrumbsPicker.ts
@jriekennotificationsList.ts
@bpaseroquickInputList.ts
@chrmarticustomView.ts
@alexr00callHierarchyPeek.ts
@jriekencommentsTreeViewer.ts
@rebornixbreakpointsView.ts
@isidorncallStackView.ts
@isidorndebugHover.ts
@isidornloadedScriptsView.ts
@isidornrepl.ts
@isidornvariablesView.ts
@isidornwatchExpressionsView.ts
@isidornextensionsViewer.ts
@sandy081extensionsViews.ts
@sandy081runtimeExtensionsEditor.ts
@sandy081explorerView.ts
@joaomorenoopenEditorsView.ts
@isidornmarkersPanel.ts
@sandy081outlinePanel.ts
@jriekenkeybindingsEditor.ts
@sandy081mainPanel.ts
@joaomorenorepositoryPanel.ts
@joaomorenosearchView.ts
@roblourensNon-Workbench List/Tree Users
These trees do not benefit from the workbench facilities. They use their own stylers. The
listBackground
needs to be added to those styles.tocTree.ts
@roblourenssettingsTree.ts
@roblourensGood: Sub-pixel AA
Bad: Normal AA
Original issue by @alexandrudima :
fyi @bpaserotake a screenshot on Windows of a tree, like the Explorer
zoom a lot
observe it uses greyscale text rendering:
if I make the following change in
listView.ts
:then, the text renders with subpixel AA:
TL;DR: From what I could tell, as soon as you have a separate layer, the layer dom node itself must have an opaque background, at all times. If it gets transparent even for a split second, it will permanently render with grayscale text. More of my findings documented here
The text was updated successfully, but these errors were encountered: