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

Bug 562576

Summary: [Win32] Tree arrows on dark background
Product: [Eclipse Project] Platform Reporter: Lars Vogel <Lars.Vogel>
Component: UIAssignee: Lars Vogel <Lars.Vogel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: 3iceh9i, alexandr.miloslavskiy, Lars.Vogel, pyvesdev
Version: 4.16   
Target Milestone: 4.16 M3   
Hardware: PC   
OS: Windows 10   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=534151
https://git.eclipse.org/r/161775
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=12f872a2b4012a2e899aaf771f73b94a23c2a655
Whiteboard:
Bug Depends on: 444560    
Bug Blocks: 560385, 562672    
Attachments:
Description Flags
Screenshot of native Tree with dark scrollbars
none
IDE in dark theme none

Description Lars Vogel CLA 2020-04-28 10:42:08 EDT
Is it possible to set the arrow colors for SWT trees? Currently we draw on top of them in platform UI via our theming but it would be great if we can avoid this, as this does not always work well. See Bug 534151.
Comment 1 Alexandr Miloslavskiy CLA 2020-04-29 14:16:21 EDT
Created attachment 282623 [details]
Screenshot of native Tree with dark scrollbars

This is how arrows look like in my native snippet. They should look the same in SWT with dark scrollbars patch. Why not just use as is?
Comment 2 Lars Vogel CLA 2020-04-29 14:26:44 EDT
(In reply to Alexandr Miloslavskiy from comment #1)
> Created attachment 282623 [details]
> Screenshot of native Tree with dark scrollbars
> 
> This is how arrows look like in my native snippet. They should look the same
> in SWT with dark scrollbars patch. Why not just use as is?

+1, I try that out. Thanks. I think our drawing was done before SWT had this ability.
Comment 3 Lars Vogel CLA 2020-04-29 15:11:44 EDT
Created attachment 282625 [details]
IDE in dark theme

Arrows without styling in platform.ui
Comment 4 Lars Vogel CLA 2020-04-29 15:13:05 EDT
Alexandr, looks awesome. Is this call handled by the OS.setTheme (isDark);	call?

If yes, I plan to deactivate / retire our custom drawing in platform ui for the dark theme.
Comment 5 Eclipse Genie CLA 2020-04-29 15:20:03 EDT
New Gerrit change created: https://git.eclipse.org/r/161775
Comment 6 Alexandr Miloslavskiy CLA 2020-04-29 15:27:41 EDT
Yes, the new arrows are a side benefit of `OS.setTheme(true)`. While we mostly use it for dark scrollbars, what it really does is selecting OS dark theme. The OS dark theme is not very complete at the moment, but already contains a few custom things for controls such as Tree and Table.
Comment 7 Alexandr Miloslavskiy CLA 2020-04-29 15:29:38 EDT
Please remember that this is only available on Win10 (since version 1809 afair).
Comment 8 Lars Vogel CLA 2020-04-29 15:34:44 EDT
(In reply to Alexandr Miloslavskiy from comment #6)
> Yes, the new arrows are a side benefit of `OS.setTheme(true)`. While we
> mostly use it for dark scrollbars, what it really does is selecting OS dark
> theme. The OS dark theme is not very complete at the moment, but already
> contains a few custom things for controls such as Tree and Table.

Cool. Thanks for the info.

> Please remember that this is only available on Win10 (since version 1809 afair).

AFAIK Eclipse IDE does not support any other windows version than Win10, so this should be fine.
 
Thanks again!
Comment 9 Pierre-Yves Bigourdan CLA 2020-04-30 03:38:21 EDT
(In reply to Lars Vogel from comment #0)
> Is it possible to set the arrow colors for SWT trees? Currently we draw on
> top of them in platform UI via our theming but it would be great if we can
> avoid this, as this does not always work well. See Bug 534151.

Another example of this not working properly: Bug 543962.
Comment 10 Lars Vogel CLA 2020-04-30 03:40:54 EDT
*** Bug 543962 has been marked as a duplicate of this bug. ***
Comment 11 Lars Vogel CLA 2020-04-30 12:54:46 EDT
*** Bug 534151 has been marked as a duplicate of this bug. ***
Comment 12 Lars Vogel CLA 2020-05-01 08:23:14 EDT
Thanks Alexandr for the tip!