Bug 430278 - [CSS] Add support for styling StyledText Scrollbars
Summary: [CSS] Add support for styling StyledText Scrollbars
Status: CLOSED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC All
: P3 normal with 13 votes (vote)
Target Milestone: 4.6 M7   Edit
Assignee: Fabio Zadrozny CLA
QA Contact:
URL:
Whiteboard:
Keywords: feep, noteworthy
Depends on: 490949 490950 490951 490980 491333 491577
Blocks: 481227 490927 491032 510009 537995 562112
  Show dependency tree
 
Reported: 2014-03-13 07:32 EDT by Fabio Zadrozny CLA
Modified: 2020-04-24 06:44 EDT (History)
10 users (show)

See Also:


Attachments
Snapshot showing how a dark theme looks on windows (85.77 KB, image/png)
2014-03-13 07:48 EDT, Fabio Zadrozny CLA
no flags Details
Win 7 and Dark theme (51.78 KB, image/png)
2014-07-23 13:32 EDT, Rade Martinović CLA
no flags Details
icons in the tree are not reall visible (30.88 KB, image/png)
2014-07-23 13:36 EDT, Rade Martinović CLA
no flags Details
scrollbars 4.5rc3 (5.37 KB, image/png)
2015-06-18 10:56 EDT, Pablo Gomez CLA
no flags Details
Themed Scrollbars with https://git.eclipse.org/r/68531 applied (only applicable for StyledText elements for now) (68.75 KB, image/png)
2016-03-16 09:43 EDT, Fabio Zadrozny CLA
no flags Details
Screenshot (141.86 KB, image/gif)
2016-04-01 10:34 EDT, Lars Vogel CLA
no flags Details
some scrollbars not styled (9.50 KB, image/png)
2016-05-09 03:27 EDT, Pablo Gomez CLA
no flags Details
screen recording showing the issue on mac (2.20 MB, video/quicktime)
2018-08-16 09:17 EDT, Matthias Becker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Zadrozny CLA 2014-03-13 07:32:53 EDT
I know SWT tries to use native widgets everywhere, but I think Scrollbars deserve an exception to be implemented in java so that styling can happen.

Every other UI toolkit does it and all the other major IDEs already style Scrollbars to look well on dark themes (i.e.: Visual Studio, Intellij), otherwise things don't look as nice... especially on Windows.
Comment 1 Fabio Zadrozny CLA 2014-03-13 07:48:56 EDT
Created attachment 240861 [details]
Snapshot showing how a dark theme looks on windows

Just attached a snapshot showing a dark theme on windows. Personally, by looking at it, it seems that the most important thing are the scrollbars and not the actual code...
Comment 2 Rade Martinović CLA 2014-07-23 13:32:46 EDT
Created attachment 245302 [details]
Win 7 and Dark theme

This is how dark theme looks on Win 7 64 bit. Not quite dark and quite distracting.
Comment 3 Rade Martinović CLA 2014-07-23 13:36:22 EDT
Created attachment 245303 [details]
icons in the tree are not reall visible

Expand icons in the tree are not really visible although on hover they have nice purple effect. Most of the images used look like they don't have proper alpha channel but like they are plain GIFs just blended with white background.
Comment 4 Pablo Gomez CLA 2015-06-18 10:56:51 EDT
Created attachment 254547 [details]
scrollbars 4.5rc3

This is still happening on 4.5RC3, the darktheme doesnt dark scrollbars on Windows 7.
Comment 5 Fabio Zadrozny CLA 2015-06-18 13:18:13 EDT
As a note, this is currently expected (and non-trivial to fix as SWT doesn't give the support as it focuses more on wrapping what the system has to offer -- and windows itself provides no such functionality).

There are workarounds to make it work 'emulating' a scrollbar, which is actually what LiClipse: http://www.liclipse.com/ does for the editors, but I don't think it's feasible to apply that to the Eclipse platform as it's a bit too hackish -- although the final result is definitely good ;)
Comment 6 Pablo Gomez CLA 2015-06-19 02:49:42 EDT
I suppose that unless another renderers are used like based on JavaFX -efxclipse project- https://wiki.eclipse.org/Efxclipse/SWTonFX
Of course I think that project is not yet mature enough. In the meantime cannot see a clean 'good' solution to have a complete dark theme
Comment 7 Pablo Gomez CLA 2015-06-19 02:52:24 EDT
just aclare, As mature enough I meant the SWTonJavaFX but not really sure about its current state anyways
Comment 8 Eclipse Genie CLA 2016-03-16 09:33:36 EDT
New Gerrit change created: https://git.eclipse.org/r/68531
Comment 9 Fabio Zadrozny CLA 2016-03-16 09:43:02 EDT
Created attachment 260341 [details]
Themed Scrollbars with https://git.eclipse.org/r/68531 applied (only applicable for StyledText elements for now)
Comment 10 Lars Vogel CLA 2016-04-01 10:34:40 EDT
Created attachment 260673 [details]
Screenshot

If I put the scrollbar relatively big, it changes it size. This should get fixed.
Comment 11 Lars Vogel CLA 2016-04-01 11:40:54 EDT
Many thanks Fabio, looks really great. I wait for Gerrit to build the last (minor) adjustments I did and then I merge it. The issue found in comment 10 can be fixed via Bug 490927.

I will ask for more testing and depending on the outcome we can leave it activated for Windows or disable it.

Can you prepare a N&N entry for ssh://youruser@git.eclipse.org:29418/www.eclipse.org/eclipse/news.git ?
Comment 12 Fabio Zadrozny CLA 2016-04-01 11:53:35 EDT
(In reply to Lars Vogel from comment #10)
> Created attachment 260673 [details]
> Screenshot
> 
> If I put the scrollbar relatively big, it changes it size. This should get
> fixed.

Humm, there are actually 2 settings for the width (one for when the mouse is not close to it and another when the mouse is close to it)... have you changed both in this case?

i.e.: "swt-scrollbar-width" and "swt-scrollbar-mouse-near-scroll-width" should have the same value if you don't want that behavior.
Comment 13 Fabio Zadrozny CLA 2016-04-01 11:56:24 EDT
Just to complement, I left the values different on purpose (i.e.: it should be a feature that when the mouse is far from the scrollbar the scrollbar is tiny).

Now, if that's not the case and you did not change the mouse position and it started flicking or if both values were the same, I'll take a look at it (or I can just change that default value in the .css if you think it should always have the same value).
Comment 15 Lars Vogel CLA 2016-04-01 12:11:59 EDT
(In reply to Fabio Zadrozny from comment #12)
> Humm, there are actually 2 settings for the width (one for when the mouse is
> not close to it and another when the mouse is close to it)... have you
> changed both in this case?

No I didn't. Please comment on Bug 490927 and mark it as invalid.
Comment 16 Lars Vogel CLA 2016-04-01 12:14:35 EDT
Fabio, is this bug and the FEEP for StyledText only? If not, please reopen so that you can use it for finish styling for the other elements, like table and trees.
Comment 17 Fabio Zadrozny CLA 2016-04-01 12:24:26 EDT
Ok, marked it closed/invalid.

Also, as you requested, I'll also prepare a N&N entry for:

ssh://youruser@git.eclipse.org:29418/www.eclipse.org/eclipse/news.git 

(although I won't be able to do it today).

Related to the FEEP, yes, it was agreed it would be for the StyledText only (changed the title to reflect that)... a new bug should be opened for Table/Trees (although I think this will be only feasible for 4.7 (I already have some ideas, but it would need changes in APIs and should be done earlier in the process -- M7 is already too late for that).
Comment 18 Fabio Zadrozny CLA 2016-04-01 12:32:07 EDT
An unrelated question: when you created 490927 it was created as a clone, so, I wanted to do the same to clone this one but change the title for Tree/Table, but when I click the 'Clone this Bug' at the bottom in my case it takes me to an empty bug... is this expected or do I need to be a commiter in the project to properly clone a bug?
Comment 20 Dani Megert CLA 2016-04-02 04:39:23 EDT
This does not work well on Windows:

Bug 490949: Themed StyledText scroll bar is missing context menu
Bug 490950: Themed StyledText scroll bar is missing scroll arrows
Bug 490951: Overview ruler inverted when using themed StyledText scroll bar
Comment 21 Dani Megert CLA 2016-04-04 02:42:43 EDT
To have special scroll bars just for text looks odd. This surfaces especially in the Compare editor which now shows a mix of scroll bars.
Comment 22 Lars Vogel CLA 2016-04-04 02:47:29 EDT
(In reply to Dani Megert from comment #21)
> To have special scroll bars just for text looks odd. This surfaces
> especially in the Compare editor which now shows a mix of scroll bars.

The long term goal is to have styled scrollbars everywhere.
Comment 23 Dani Megert CLA 2016-04-04 03:41:34 EDT
Found another problem:
Bug 490980: Auto-scroll (un-) lock in Console does not work with themed StyledText scroll bar
Comment 24 Rade Martinović CLA 2016-04-04 08:22:49 EDT
Well, the long term goal is clear. Hopefully, this all can be fixed until code freeze.
Comment 25 Dani Megert CLA 2016-04-04 09:47:13 EDT
(In reply to Rade Martinovi? from comment #24)
> Well, the long term goal is clear. Hopefully, this all can be fixed until
> code freeze.

Then this is better moved to 4.7 where we can provide that story.
Comment 26 Lars Vogel CLA 2016-04-04 10:14:49 EDT
(In reply to Dani Megert from comment #25)
> (In reply to Rade Martinovi? from comment #24)
> > Well, the long term goal is clear. Hopefully, this all can be fixed until
> > code freeze.
> 
> Then this is better moved to 4.7 where we can provide that story.

Since introduction, the dark theme is far from perfect, especially under Window Any improvement to the existing experience is helpful to our users.
Comment 27 Fabio Zadrozny CLA 2016-04-04 12:18:36 EDT
Just wanted to add that this is being done under the FEEP and the final decision to have at least the StyledText for 4.6 was something which the FEEP itself ended up thinking would be already a good step forward (so, many people think this is already a worthy addition as is).

Also, as Lars said, the dark theme experience (especially on Windows) hasn't been great from the start and is being improved organically at each release (and hopefully the next will improve even more), and I believe this is good step forward in that direction.

I'm aware that right scrollbar styles are mixed, but I still think this makes the UI better than not having that support on the StyledText -- and if someone thinks it's too bad, there's a way to opt-out by using "-Dswt.enable.themedScrollBar=false"... and in non-windows platforms, where the current status quo is not as bad, "-Dswt.enable.themedScrollBar=true" can be used to opt-in.

I'm also aware that there are things that can't be overcome with the current SWT implementation (because it has no API to really change the ScrollBar object implementation, the code has to work-around it and things such as the oddity in the compare view end up happening -- unfortunately this requires a change in the SWT API which I think is too late to be introduced at this point).
Comment 28 Lars Vogel CLA 2016-04-04 12:44:38 EDT
(In reply to Fabio Zadrozny from comment #17)
> a new bug should be opened for  Table/Trees 

Opened Bug 491032
Comment 29 Dani Megert CLA 2016-04-05 04:34:32 EDT
(In reply to Fabio Zadrozny from comment #27)
> Just wanted to add that this is being done under the FEEP and the final
> decision to have at least the StyledText for 4.6 was something which the
> FEEP itself ended up thinking would be already a good step forward (so, many
> people think this is already a worthy addition as is).
> 
> Also, as Lars said, the dark theme experience (especially on Windows) hasn't
> been great from the start and is being improved organically at each release
> (and hopefully the next will improve even more), and I believe this is good
> step forward in that direction.

Fair enough. I'm not using the dark theme, hence those really using it should decide whether this is better for them or not.
Comment 30 Eclipse Genie CLA 2016-04-05 08:26:25 EDT
New Gerrit change created: https://git.eclipse.org/r/69905
Comment 31 Fabio Zadrozny CLA 2016-04-05 08:27:41 EDT
Note: gerrit review for adding it to the New & Noteworthy.
Comment 33 Pablo Gomez CLA 2016-05-09 03:27:03 EDT
Created attachment 261543 [details]
some scrollbars not styled

not sure if this was expected for this build but I've been testing the M7 darktheme and there still some scrollbars that are not yet styled so I just thoght to write a comment here. E.g. Project Explorer, Plugins. Problems, Target Platform State, interestingly the Console scrollbars are styled great both vertical and horizontal, of course the java editor is also perfectly styled. Definitely a nice improvement.
Comment 34 Fabio Zadrozny CLA 2016-05-09 06:28:18 EDT
(In reply to Pablo Gomez from comment #33)
> Created attachment 261543 [details]
> some scrollbars not styled
> 
> not sure if this was expected for this build but I've been testing the M7
> darktheme and there still some scrollbars that are not yet styled so I just
> thoght to write a comment here. E.g. Project Explorer, Plugins. Problems,
> Target Platform State, interestingly the Console scrollbars are styled great
> both vertical and horizontal, of course the java editor is also perfectly
> styled. Definitely a nice improvement.

Hi Pablo,

This is expected (you can see the release notes at https://www.eclipse.org/eclipse/news/4.6/M7/).

The related bug is https://bugs.eclipse.org/bugs/show_bug.cgi?id=491032 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=491032#c2 has comments on why it wasn't done for 4.6M7).
Comment 35 Matthias Becker CLA 2018-08-16 09:16:23 EDT
i just enabeld it on macOS and the vertical scrollbar appears when the mouse comes close but disappears again before I can click it.
Comment 36 Matthias Becker CLA 2018-08-16 09:17:07 EDT
Created attachment 275426 [details]
screen recording showing the issue on mac
Comment 37 Lars Vogel CLA 2018-08-16 09:17:48 EDT
(In reply to Matthias Becker from comment #35)
> i just enabeld it on macOS and the vertical scrollbar appears when the mouse
> comes close but disappears again before I can click it.

I suggest to handle this via a new bug which depends on this one, this bug is already older and Fabio only activated it for Windows.
Comment 38 Matthias Becker CLA 2018-08-16 09:29:33 EDT
(In reply to Lars Vogel from comment #37)
> (In reply to Matthias Becker from comment #35)
> > i just enabeld it on macOS and the vertical scrollbar appears when the mouse
> > comes close but disappears again before I can click it.
> 
> I suggest to handle this via a new bug which depends on this one, this bug
> is already older and Fabio only activated it for Windows.

done. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=537995
Comment 39 Lars Vogel CLA 2020-04-24 06:44:38 EDT
Bug 444560 introduce dark scrollbars on an SWT level.