| Summary: | [HiDPI][Win32] Tree expansion triangle issues | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Thomas Singer <eclipse> |
| Component: | SWT | Assignee: | Conrad Groth <info> |
| Status: | RESOLVED FIXED | QA Contact: | Niraj Modi <niraj.modi> |
| Severity: | normal | ||
| Priority: | P3 | CC: | gautier.desaintmartinlacaze, info, Lars.Vogel, lshanmug, nikita, niraj.modi, peter |
| Version: | 4.5 | ||
| Target Milestone: | 4.8 M7 | ||
| Hardware: | PC | ||
| OS: | Windows NT | ||
| See Also: |
https://git.eclipse.org/r/116664 https://git.eclipse.org/r/122007 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=3b871dbaca01b0bfa4dade0a4713684d07f25402 |
||
| Whiteboard: | |||
| Bug Depends on: | 155817 | ||
| Bug Blocks: | 517055 | ||
| Attachments: | |||
Bug 509126 is a similar issue. Maybe both can be resolved together. (In reply to Thomas Singer from comment #0) > Created attachment 257495 [details] > tree expansion icons of Windows File Explorer and SmartGit (using SWT 4.5) > > I'm using Windows 8.1 with a quad-HD resolution (200% zoom level). I've > noticed two issues with trees: > > - the expansion triangles are not scaled Tested with latest Eclipse release, I don't see this problem on Win10/Win7. > - in the Windows File Explorer the triangles automatically if the tree loses > the focus Please share more details on above point, it's not clear to me. Created attachment 272483 [details]
Screenshot on Windows 10 - File Explore vs. SmartGit with SWT
> - in the Windows File Explorer the triangles automatically if the tree loses the
> focus
Sorry, the word "hide" is missing. It should read:
- in the Windows File Explorer the triangles automatically hide if the tree loses the focus or the mouse cursor moves away
Attached are screenshots of SmartGit 18.1 preview as well as from Eclipse 4.7.2 and 4.8M5 showing the problem if too small triangles in SWT.
Created attachment 272484 [details]
Windows 10 - File Explorer vs. Eclipse 4.7.2
Created attachment 272485 [details]
Windows 10 - File Explorer vs. Eclipse 4.8M5
(In reply to Thomas Singer from comment #6) > Created attachment 272485 [details] > Windows 10 - File Explorer vs. Eclipse 4.8M5 What's the OS zoom level here ? I'm using 200% zoom. (In reply to Thomas Singer from comment #0) > ... > - in the Windows File Explorer the triangles automatically if the tree loses > the focus This can be enabled by the VM argument "-Dorg.eclipse.swt.internal.win32.enableFadeInOutExpandos". The issue only occurs without images. The reason can be found here: https://developercommunity.visualstudio.com/content/problem/46919/explorer-themed-cmfc-ctreectrl-not-high-dpi-aware.html (In reply to Conrad Groth from comment #9) > (In reply to Thomas Singer from comment #0) > > ... > > - in the Windows File Explorer the triangles automatically if the tree loses > > the focus > > This can be enabled by the VM argument > "-Dorg.eclipse.swt.internal.win32.enableFadeInOutExpandos". I've tried this with Snippet15 (http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet15.java), but don't see any difference on Windows 10. New Gerrit change created: https://git.eclipse.org/r/116664 (In reply to Thomas Singer from comment #11) > (In reply to Conrad Groth from comment #9) > > (In reply to Thomas Singer from comment #0) > > > ... > > > - in the Windows File Explorer the triangles automatically if the tree loses > > > the focus > > > > This can be enabled by the VM argument > > "-Dorg.eclipse.swt.internal.win32.enableFadeInOutExpandos". > > I've tried this with Snippet15 > (http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/ > org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet15.java), but > don't see any difference on Windows 10. That's strange. For me the fading also doesn't work with Snippet15, but with the ControlExample. The tree has to be able to lose the focus to fade out the triangles and because it's the only Control in Snippet15, the tree cannot lose the focus. As soon as you add another control, e.g. a Button, to the snippet and click on the button, the fading of the tree triangles work. I think, that's no problem for real life applications, as they most likely have more than one control ;) The fading seems not to work for owner-drawn trees, right? When using it in SmartGit, it does not work for the Repositories and Branches view, but for the tree in the preferences dialog. (In reply to Thomas Singer from comment #15) > The fading seems not to work for owner-drawn trees, right? When using it in > SmartGit, it does not work for the Repositories and Branches view, but for > the tree in the preferences dialog. I looked into the code and indeed the fading is disabled if any background color is set, even if it's the system default. I don't know why that was implemented. The comment says: Feature in Windows. When TVM_SETBKCOLOR is used to set the background color of a tree, the plus/minus animation draws badly. The fix is to clear the effect. (In reply to Conrad Groth from comment #16) > I looked into the code and indeed the fading is disabled if any background > color is set, even if it's the system default. I don't know why that was > implemented. The comment says: > Feature in Windows. When TVM_SETBKCOLOR is used to set the background color > of a tree, the plus/minus animation draws badly. The fix is to clear the > effect. Searched for the possible reason for this implementation. Below bug seems related and which may have introduced a fix to the bad drawing with expand(plus/minus) in Tree class (possibly for WinXP only): https://bugs.eclipse.org/bugs/show_bug.cgi?id=155817 Going by the code comments also, Tree's plus/minus is more of WinXP specific UI element. And if this assumption is correct and since WinXP is no longer relevant: We can try to introduce this fading animation effect back for Win7 and onward OS version. Hi Conrad, If required we can split this bug for the two issues mentioned in comment 0 Also note, next week is last week of development for M6. (In reply to Niraj Modi from comment #18) > Hi Conrad, > If required we can split this bug for the two issues mentioned in comment 0 > Also note, next week is last week of development for M6. Created follow up bug 531971 for the fading issue. I also updated the patch and it now uses the native device zoom to scale up the needed indent! The device zoom (configured via the property swt.autoScale) doesn't make sense, as the triangle size only depends on the native device zoom. @Thomas: Which method did you use to scale SmartGit, the native device zoom (via system settings -> resolution) or the device zoom (configurable by the property swt.autoScale) ? For non-Mac systems we are investigating org.eclipse.swt.internal.deviceZoom and calculate from display.getDPI().x / 96. (In reply to Conrad Groth from comment #19) > (In reply to Niraj Modi from comment #18) > > Hi Conrad, > > If required we can split this bug for the two issues mentioned in comment 0 > > Also note, next week is last week of development for M6. > > Created follow up bug 531971 for the fading issue. > > I also updated the patch and it now uses the native device zoom to scale up > the needed indent! The device zoom (configured via the property > swt.autoScale) doesn't make sense, as the triangle size only depends on the > native device zoom. Hi Conrad, Few outstanding comments needs to be addressed before we commit, please refer gerrit. Thanks! New Gerrit change created: https://git.eclipse.org/r/122007 I've created a simplified version of Conrad's patch. It fixes scaling for trees without images. Trees with images will fix themselves when swt.autoScale=exact and swt.autoScale.method=smooth. Gerrit change https://git.eclipse.org/r/122007 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=3b871dbaca01b0bfa4dade0a4713684d07f25402 Thanks Conrad and Nikita for the fix. |
Created attachment 257495 [details] tree expansion icons of Windows File Explorer and SmartGit (using SWT 4.5) I'm using Windows 8.1 with a quad-HD resolution (200% zoom level). I've noticed two issues with trees: - the expansion triangles are not scaled - in the Windows File Explorer the triangles automatically if the tree loses the focus