-
Notifications
You must be signed in to change notification settings - Fork 129
set background color for variables view in dark mode #1788
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: master
Are you sure you want to change the base?
set background color for variables view in dark mode #1788
Conversation
@tobias-melcher Would you please try instead removing setBackground calls in Line 1165 in a791b17
Please test in both light and dark. |
I tried this. It was still flickering after removing both calls I have seen that tree.setBackground() is called with null of the VariablesView by the CSS engine and I assume that his is making the problem. The flickering does not appear on Windows, only on MacOS. So, the SWT tree implementation for Mac behaves differently than on Windows regarding setBackground(null) call. |
IIRC we also configure the SWT colors according to the theme but they are set to late during startup. @azoitl tried to fix this a long time ago. See eclipse-platform/eclipse.platform.ui#259 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=577912 |
@vogella, could you please point me to the location where the Theming Engine is overriding the SWT.COLOR_LIST_BACKGROUND color for the dark mode. I cannot find it. Thanks a lot. |
I know of this location: but there SWT.COLOR_LIST_BACKGROUND is not redefined. |
flickering appears because the tree background color is sometimes set to white in the dark mode because of following CSS: Tree[swt-lines-visible="true"] org.eclipse.e4.ui.css.swt.helpers.CSSSWTColorHelper#setBackground is then called with color argument "null" and the SWT Tree implementation on MacOS then takes its default background color via display.getWidgetColor (SWT.COLOR_LIST_BACKGROUND); . I don't see a mechanism where the display widget colors are overridden by the CSS styles. Unfortunately, I don't know in which CSS file this "background-color: unset;" is written down. There are too many CSS files. |
|
thanks so much. Removing
from bundles/org.eclipse.ui.themes/css/e4-dark_mac.css fixes the flickering problem. Do you know the reason why this was introduced? |
Maybe to handle an older now fixed bug in SWT Mac? If you do not see a bad impact in the light theme with this line removed, just send a PR to remove it. Maybe the same applies for the CSS for trees? |
I removed
from e4-dark_mac.css locally and did some testing. Unfortunately, the zebra style then disappears from the "Problems" and other views. So, this approach is not the way to go because zebra seems quite important in the dark theme. I would therefore vote that we go with the approach of this pull request by explicitly setting a background color for the Variables view so that the white flickering while expanding tree nodes disappears. This white flickering hurts in the eyes and must be fixed from my point of view. |
53794e6
to
b9adeb0
Compare
windows build failure is unrelated. |
@@ -57,4 +57,5 @@ IEclipsePreferences#org-eclipse-debug-ui { | |||
|
|||
#VariablesViewer { | |||
font-family: '#org-eclipse-debug-ui-VariableTextFont'; | |||
background-color: #2F2F2F; |
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.
this change causes a side effect: The tree in the variables view does then no longer have the zebra 🦓 lines.
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.
The interesting thing is that e.g. JDTs problems view also uses this zebra feature but does not have this flickering issue.
Variables View on MacOS flickers with white background in dark mode when variable nodes are expanded via the keyboard.
See screencast:
variable_viewer_white_background.mov
One can also see that the Variables View gets a white background after closing a debug session.
This pull request sets a dark background color for the Variables View in the css style settings so that the flickering disappears.