Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348309 - [10.7]Awkward Scroll Bars
Summary: [10.7]Awkward Scroll Bars
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 340954 340956 355290 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-04 17:18 EDT by Moritz Lichter CLA
Modified: 2011-08-23 11:33 EDT (History)
9 users (show)

See Also:


Attachments
Screenshot that shows the current appearance of SWT scrollbars on OS X Lion (29.47 KB, image/png)
2011-06-05 06:37 EDT, Moritz Lichter CLA
no flags Details
Screenshot that shows how the scrollbars should look like. (80.99 KB, image/png)
2011-06-05 06:38 EDT, Moritz Lichter CLA
no flags Details
Screenshot showing the Appearance options. (30.44 KB, image/png)
2011-06-08 14:58 EDT, Moritz Lichter CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Lichter CLA 2011-06-04 17:18:10 EDT
Scroll Bars look strange on Mac OS X LION. The introduced a new scroll bar look similar to iPhone or iPad. But the SWT Scrollbars mix the old and the new look! The still use the old background.

-- I will add a screenshot as far as a have one --
Comment 1 Moritz Lichter CLA 2011-06-05 06:37:03 EDT
Created attachment 197352 [details]
Screenshot that shows the current appearance of SWT scrollbars on OS X Lion

The Screenshots shows the current appearance of scrollbars on Mac OS X Lion. As you can see, the old scrollbar background is kept, but the gray slider should just appear about the composite. Also the gray slider is expected to hide automatically if the mouse is not near to it and the user is not using the mouse wheel.
Comment 2 Moritz Lichter CLA 2011-06-05 06:38:18 EDT
Created attachment 197353 [details]
Screenshot that shows how the scrollbars should look like.

The screenshot shows a scrollbar of Safari. There is no scrollbar background anymore.
Comment 3 Moritz Lichter CLA 2011-06-08 14:56:26 EDT
This was not complete correct. You are able to get this strange looking scrollbars if you select "Appearance" --> "Show scroll bars" --> "Always".  But I think that only very few users will use this option (because the scroll bars look strange). So the SWT scroll bars should be able to adapt the correct look automatically.
Comment 4 Moritz Lichter CLA 2011-06-08 14:58:44 EDT
Created attachment 197629 [details]
Screenshot showing the Appearance options.

This screenshots shows the Appearance panel in the System Preferences of Mac OS Lion. There you can choose whether the scroll bars should always be visible or not.
Comment 5 Silenio Quarti CLA 2011-08-04 12:16:40 EDT
The scrollbar look depends on a system settings in the General tab. Your problem only happens when the "Show scroll bars" setting is "When Scrolling" either explicitly set or not (i.e. Automatically based on input device).

The problem happens because SWT subclasses NSScroller and as of 10.7 subclasses need to implement isCompatibleWithOverlayScrollers to support overlay scrollers.

http://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSScroller_Class/Reference/Reference.html#//apple_ref/occ/clm/NSScroller/isCompatibleWithOverlayScrollers

Implementing this method does not seem to be enough to solve all the problems. There are two problems I need to investigate:

- When the scroll bars are shown in a Tree widget (package explorer for example), it never gets hidden.
- The scroll bars are never shown in the Editor.
Comment 6 Silenio Quarti CLA 2011-08-05 11:43:48 EDT
(In reply to comment #5)
> There are two problems I need to investigate:
> 
> - When the scroll bars are shown in a Tree widget (package explorer for
> example), it never gets hidden.

This problem is caused because we overwrite setFrameSize: in our subclass of NSOutlineView. I do not quite understand what is happening given that our implementation of setFrameSize: just calls the super implementation. I tried moving the code to C (removing the JNI bridge), but the problem still happens.  Given that we are not doing anything in our sub implementation, I have removed it.

> - The scroll bars are never shown in the Editor.

We need to call NSScroller.flashScrollers() when the selection of a scrollbars changes in a SWT canvas. This is necessary because the bounds origin of the NSScrollView's content view does not change ever. 

Fixed

http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=beb3230a14d718993438b762d3e460dbe17629f9
Comment 7 Silenio Quarti CLA 2011-08-05 11:44:18 EDT
This is going to be ported to 3.7.1 once it gets more testing.
Comment 8 Silenio Quarti CLA 2011-08-17 11:50:33 EDT
Reopening to fixed in 3.7.1
Comment 10 Silenio Quarti CLA 2011-08-17 12:12:13 EDT
*** Bug 340954 has been marked as a duplicate of this bug. ***
Comment 11 Silenio Quarti CLA 2011-08-17 12:13:05 EDT
*** Bug 340956 has been marked as a duplicate of this bug. ***
Comment 12 Silenio Quarti CLA 2011-08-23 11:33:40 EDT
*** Bug 355290 has been marked as a duplicate of this bug. ***