-
Notifications
You must be signed in to change notification settings - Fork 13
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
Background color is modified when enabling flat scroll bars #94
Comments
Hm, interesting. I have a vague idea. If I remember correctly, Flat Scrollbars on trees and tables are implemented using a ScrollableAdapter which basically extends a Composite and wraps the tree or table instance at runtime. It's a bit of a 'children don't do this at home' concept. I guess that the ScrollableAdapter composite applies the Composite style setting instead of the tree background color and the tree inherits the color from the parent or something like this. Which would be a bug. of course. However, I must dig into to the code, because I currently can't remember where the css style application takes place... |
The mechanism described in my last comment might be located somewhere in com.codeaffine.eclipse.ui.swt.theme.ColorApplicator class in the swt.theme module |
Thanks for the response! I had a quick dig around the xiliary/com.codeaffine.eclipse.swt/src/com/codeaffine/eclipse/swt/widget/scrollable/TreeAdapter.java Line 298 in 101b004
This breakpoint was only ever hit with red or white. I noticed that there was an
The breakpoint started being hit with blue through the Xiliary code, but was then hit again with red, overriding the blue colour. The call stack for red is purely Eclipse though:
Two conclusions so far:
I then used the E4 CSS Spy tool and noticed that the widget name displayed was
And that gave the expected result! 🎉 I haven't tried other scrollable objects but I'm hoping a similar trick will just work. In the end, not sure whether there's any bug here. Eclipse does its job in an opinionated way, but does it correctly. Xiliary does the job correctly on its own side. The two just don't quite line up in the desired way in this specific case. Unless you have an easy idea to force As a side note, do you remember off hand what the difference between |
Sorry for answering late, but it has been a busy week so far. And thanks for digging into the issue. Well, to me your proposal seems fair enough and accordingly I've mentioned the particular configuration scenario in the README file. With respect to your side note: as far as I remember, the adapter-background-top-level is somehow applicable on shells that do not have a parent shell. Hence the top-level notion. Somewhere in the depths of my brain I seem to remember that this has to do something with dialog's background color of trees, for example in the preference dialog. It might be that this way it is possible to have a tree background color on the top-level shell, that is not used on a Dialog window. It might be one of the desperate measures I have done to get this thing of the ground on windows... |
Hello hello,
I was playing around with a custom theme and I noticed that enabling flat scroll bars may change the background colour of the different UI elements.
Consider the following simple bit of CSS to reproduce the problem:
The background colour of my tree appears as blue. However, when I switch
flat-scroll-bar
totrue
,background-color: blue
no longer takes precedences or may simply be ignored, the background colour of my tree turns to red.Any idea on what might be happening? Do you know of any CSS trick that would force the background to stay blue?
Thanks in advance!
The text was updated successfully, but these errors were encountered: