Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 563497

Summary: Trim bar handles are not scaled properly
Product: [Eclipse Project] Platform Reporter: Pierre-Yves Bigourdan <pyvesdev>
Component: UIAssignee: Matthias Becker <ma.becker>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aobuchow, kalyan_prasad, Lars.Vogel, ma.becker, sebastian.ratz
Version: 4.15   
Target Milestone: 4.20 M2   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=563079
https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165779
https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165805
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=878ede4d5379463e47124ef2e10facb497527d68
https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/178348
https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/178349
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=a0b3b60c1440b7e48d8bfb4f0698b4632158a71c
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=b585373207295d55344a5f6e87a75ef2458acb67
https://git.eclipse.org/r/c/platform/eclipse.platform.images/+/179284
https://git.eclipse.org/c/platform/eclipse.platform.images.git/commit/?id=d73e6828d2be33c12e67ce1f4574393007fcd222
Whiteboard:
Bug Depends on:    
Bug Blocks: 571203    
Attachments:
Description Flags
Bad scaling of trim bar handles
none
Handles on Windows
none
Debugger Screenshot
none
With my patch on dark theme
none
With my patch on light theme
none
With patch on Windows
none
Handles with patch set 6
none
Dark Linux with patch
none
Light Linux with patch
none
Screenshot Windows none

Description Pierre-Yves Bigourdan CLA 2020-05-23 05:43:57 EDT
Created attachment 282997 [details]
Bad scaling of trim bar handles

Trim bar handles are not scaled properly, as you can see in the attached screenshot. This is most visible on Windows, but other operating systems are impacted as well.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=563079#c33 for more details.
Comment 1 Eclipse Genie CLA 2020-07-03 03:23:47 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165779
Comment 2 Matthias Becker CLA 2020-07-03 03:28:18 EDT
(In reply to Eclipse Genie from comment #1)
> New Gerrit change created:
> https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165779

This should fix the wrongly scaped handle images. On macOS it looks nice.
Can somebody pls. test in the various themes on windows and linux?
Comment 3 Lars Vogel CLA 2020-07-03 03:45:35 EDT
(In reply to Matthias Becker from comment #2)
> (In reply to Eclipse Genie from comment #1)
> > New Gerrit change created:
> > https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165779
> 
> This should fix the wrongly scaped handle images. On macOS it looks nice.
> Can somebody pls. test in the various themes on windows and linux?

Looks good on Linux as well. I suggest to merge for M1.
Comment 4 Eclipse Genie CLA 2020-07-03 09:27:41 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165805
Comment 5 Matthias Becker CLA 2020-07-03 09:32:44 EDT
(In reply to Eclipse Genie from comment #4)
> New Gerrit change created:
> https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165805

This removed the frames around the trim bars. Can somebody look at this on windows and linux?
Comment 6 Andrew Obuchowicz CLA 2020-07-03 12:35:29 EDT
(In reply to Matthias Becker from comment #5)
> (In reply to Eclipse Genie from comment #4)
> > New Gerrit change created:
> > https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165805
> 
> This removed the frames around the trim bars. Can somebody look at this on
> windows and linux?

I tried out the patch (one Linux) but couldn't tell exactly what the difference was with the patch applied and not applied. Could you help point out the differences? (Maybe with a before/after photo?)
Comment 7 Pierre-Yves Bigourdan CLA 2020-07-03 12:57:13 EDT
Created attachment 283504 [details]
Handles on Windows

(In reply to Eclipse Genie from comment #1)
> New Gerrit change created:
> https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165779

Unfortunately, this does not seem to work on Windows. Probably related to the issues I've described in https://bugs.eclipse.org/bugs/show_bug.cgi?id=563079#c43
Comment 8 Matthias Becker CLA 2020-07-14 10:21:09 EDT
(In reply to Pierre-Yves B. from comment #7)
> Created attachment 283504 [details]
> Handles on Windows
> 
> (In reply to Eclipse Genie from comment #1)
> > New Gerrit change created:
> > https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165779
> 
> Unfortunately, this does not seem to work on Windows. Probably related to
> the issues I've described in
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=563079#c43

Hi Pierre,

I don't have a windows machine. Can you pls. dig into this an update the gerrit?
Comment 9 Pierre-Yves Bigourdan CLA 2020-07-16 16:11:19 EDT
I'm still confused as to why it's working on Unix systems. You indicated in https://bugs.eclipse.org/bugs/show_bug.cgi?id=563079#c44 that url(./winTSFrame.png) from the CSS is translated to file:/......./org.eclipse.ui.themes/images/./winTSFrame.png. What does that translation? It doesn't seem intuitive to me.

Why do we still need the CSS parameters at all? If none are specified, the theme engine falls back to the images in org.eclipse.e4.ui.workbench.swt. If we're now using the same ones for all operating systems, there's little point in having the overrides. :)
Comment 10 Matthias Becker CLA 2021-03-02 10:58:50 EST
Created attachment 285705 [details]
Debugger Screenshot

(In reply to Pierre-Yves Bigourdan from comment #9)
> I'm still confused as to why it's working on Unix systems. You indicated in
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=563079#c44 that
> url(./winTSFrame.png) from the CSS is translated to
> file:/......./org.eclipse.ui.themes/images/./winTSFrame.png. What does that
> translation? It doesn't seem intuitive to me.
> 
> Why do we still need the CSS parameters at all? If none are specified, the
> theme engine falls back to the images in org.eclipse.e4.ui.workbench.swt. If
> we're now using the same ones for all operating systems, there's little
> point in having the overrides. :)

Dear Perrre-Yves,

the "translation" from "./winTSFrame.png" to the "file:/...." path happens in 
OSGIResourceLocator (see the attached screenshot). The path that is created on macOS is fine. I also checked with a co-worker on his windows machine. There that
relative filename is "translated" to something like:

"file:...plugins/org.eclipse.ui.themes_1.2.1300.v20210108-1832/images/./dragHandle.png"
which also loads fine on his computer.

Can you please debug at that location and tell me what the problem is on your side?
Comment 11 Matthias Becker CLA 2021-03-03 02:44:18 EST
(In reply to Pierre-Yves Bigourdan from comment #9)
> I'm still confused as to why it's working on Unix systems. You indicated in
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=563079#c44 that
> url(./winTSFrame.png) from the CSS is translated to
> file:/......./org.eclipse.ui.themes/images/./winTSFrame.png. What does that
> translation? It doesn't seem intuitive to me.
> 
> Why do we still need the CSS parameters at all? If none are specified, the
> theme engine falls back to the images in org.eclipse.e4.ui.workbench.swt. If
> we're now using the same ones for all operating systems, there's little
> point in having the overrides. :)

I updated https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165779 now.
I removed the CSS parameters as the drag handle images anyway are identical now.

As all themes are touched on all OSes we need good manual tests.
Pls. test with: 
a) themeing disabled
b) all available themes of your OS

For a) and b) have collapsed trim stacks on left/right and bottom edge of the window. Also move the collapsed trim stacks around (e.g. from left to bottom edge or vise versa). The trim handle dots should be squared and look good on "normal" resolution screens and "high" resolution screens.

I tested on macOS with theming disabled, light, dark, classic and system theme. All look good.
Comment 12 Matthias Becker CLA 2021-03-03 02:44:38 EST
Created attachment 285712 [details]
With my patch on dark theme
Comment 13 Matthias Becker CLA 2021-03-03 02:45:04 EST
Created attachment 285713 [details]
With my patch on light theme
Comment 14 Sebastian Ratz CLA 2021-03-05 12:35:12 EST
Created attachment 285747 [details]
With patch on Windows
Comment 15 Pierre-Yves Bigourdan CLA 2021-03-05 12:37:47 EST
(In reply to Matthias Becker from comment #10)
> Can you please debug at that location and tell me what the problem is on
> your side?

Even if the final solution makes the problem go away by removing the CSS, yes, I can take a look in the coming days or weeks. :)
Comment 16 Matthias Becker CLA 2021-03-05 13:54:48 EST
(In reply to Pierre-Yves Bigourdan from comment #15)
> (In reply to Matthias Becker from comment #10)
> > Can you please debug at that location and tell me what the problem is on
> > your side?
> 
> Even if the final solution makes the problem go away by removing the CSS,
> yes, I can take a look in the coming days or weeks. :)

Yes. That would be great.
Comment 17 Pierre-Yves Bigourdan CLA 2021-03-13 09:51:19 EST
I updated to the latest nightly version of the IDE, but that caused errors on the Platform UI code from patch set 3 as it dates back from July. Therefore I locally rebased that old patch set on the latest version of the Platform UI code base. Following that, I am no longer able to reproduce the behaviour that I screenshoted in https://bugs.eclipse.org/bugs/show_bug.cgi?id=563497#c7. Maybe something was fixed in the more recent version of the IDE, maybe something was fixed in the more recent version of the Platform UI code base. Hard to tell as it's been over 8 months of changes, and frankly I don't think there's much value in digging any further. I'll instead do a bit more testing on patch set 6 and report back.
Comment 18 Pierre-Yves Bigourdan CLA 2021-03-13 09:58:41 EST
Created attachment 285832 [details]
Handles with patch set 6

With patch set 6, using Windows, the handles still don't look quite right, but only when rotated horizontally. The vertical ones look good.

In the attached screnshot, note how the horizontal handler has a larger space in between the two middle dots, and how it looks darker compared to its vertical counterpart.

Is this something you can reproduce?
Comment 19 Matthias Becker CLA 2021-03-15 10:15:23 EDT
(In reply to Pierre-Yves Bigourdan from comment #18)
> Is this something you can reproduce?
Yes. It seems that the icon is scaled on windows - on macOS it looks good.
It also seems that this scaling is unrelated to this change. Can you confirm this? If yes I propose we merge this change and create a follow up for the scaling issue...
Comment 20 Lars Vogel CLA 2021-03-15 12:03:21 EDT
Created attachment 285841 [details]
Dark Linux with patch
Comment 21 Matthias Becker CLA 2021-03-15 12:21:30 EDT
(In reply to Lars Vogel from comment #20)
> Created attachment 285841 [details]
> Dark Linux with patch

Does it look better then without may patch?
Comment 22 Lars Vogel CLA 2021-03-15 12:26:12 EDT
Created attachment 285842 [details]
Light Linux with patch

Looks better IMHO on Linux dark and light theme.
Comment 24 Pierre-Yves Bigourdan CLA 2021-03-18 07:47:39 EDT
(In reply to Matthias Becker from comment #19)
> (In reply to Pierre-Yves Bigourdan from comment #18)
> > Is this something you can reproduce?
> Yes. It seems that the icon is scaled on windows - on macOS it looks good.
> It also seems that this scaling is unrelated to this change. Can you confirm
> this?

Yes, that was already the case, as I described over here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=563079#c33
Comment 25 Matthias Becker CLA 2021-03-24 03:22:50 EDT
*** Bug 563277 has been marked as a duplicate of this bug. ***
Comment 26 Eclipse Genie CLA 2021-03-25 03:55:40 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/178348
Comment 27 Eclipse Genie CLA 2021-03-25 03:55:42 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/178349
Comment 30 Eclipse Genie CLA 2021-04-14 01:36:11 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.images/+/179284
Comment 32 Lars Vogel CLA 2021-04-15 06:02:00 EDT
Created attachment 286104 [details]
Screenshot Windows

Looks good to me in Eclipse SDK
Version: 2021-06 (4.20)
Build id: I20210414-0330
OS: Windows 8, v.6.2, x86_64 / win32
Java version: 15.0.2


Note: The D&D color of a toolbar is wrong in the dark theme but that is a difference issue.
Comment 33 Matthias Becker CLA 2021-04-15 08:30:04 EDT
(In reply to Lars Vogel from comment #32)
> Created attachment 286104 [details]
> Screenshot Windows
> 
> Looks good to me in Eclipse SDK
> Version: 2021-06 (4.20)
> Build id: I20210414-0330
> OS: Windows 8, v.6.2, x86_64 / win32
> Java version: 15.0.2
> 
> 
> Note: The D&D color of a toolbar is wrong in the dark theme but that is a
> difference issue.

What happen to your linux laptop?
Comment 34 Lars Vogel CLA 2021-04-15 08:48:57 EDT
(In reply to Matthias Becker from comment #33)

> What happen to your linux laptop?

This week I use windows, next week I will be back to Linux.
Comment 35 Matthias Becker CLA 2021-06-04 01:41:33 EDT
*** Bug 563083 has been marked as a duplicate of this bug. ***