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

Bug 180027

Summary: Text scrollbar always visible
Product: [Eclipse Project] Platform Reporter: Nick Edgar <n.a.edgar>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, markus.kell.r
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
With V_SCROLL, short text
none
no V_SCROLL, no scrollbars ever none

Description Nick Edgar CLA 2007-03-29 12:19:50 EDT
3.3 M5

In a dialog with a multi-line text, I'd like to have it show the scrollbar only if needed.  If I specify V_SCROLL, it always appears currently.
Comment 1 Nick Edgar CLA 2007-03-29 12:20:41 EDT
back-ref four our bug db: #19596
Comment 2 Steve Northover CLA 2007-03-29 18:20:14 EDT
Scroll bar display policy is operating system specific.  We can't/shouldn't change this.
Comment 3 Steve Northover CLA 2007-03-29 18:20:54 EDT
You could use SWT.WRAP and not specify SWT.V_SCROLL?  Anyhow, WONTFIX.
Comment 4 Nick Edgar CLA 2007-03-30 09:05:18 EDT
I am specifying WRAP, and tried V_SCROLL with it, but that still makes the scroll bar always appear, not just when the text exceeds the vertical space.
Comment 5 Nick Edgar CLA 2007-03-30 09:05:54 EDT
> You could use SWT.WRAP and not specify SWT.V_SCROLL
Sorry, yes, that's what I decided on.  But it means no scroll bar appears when the text -does- exceed the vertical space.
Comment 6 Steve Northover CLA 2007-03-30 09:11:49 EDT
The vertical scroll bar will always appear, unless you don't specify V_SCROLL.  I think you should just give in to the platforms look and feel.  Does the text control really look that ugly in your application?
Comment 7 Nick Edgar CLA 2007-03-30 09:31:36 EDT
"give in to the platforms look and feel" == "surrender to the dark side"

> Does the text control really look that ugly in your application?
It's a small box as part of an editor, so it does look quite bad with the (disabled until needed) scrollbar there.
Comment 8 Steve Northover CLA 2007-03-30 09:39:45 EDT
Nick, how far you have fallen.  The operating system is your friend.  Have you run your application on Vista yet?  If built from standard widgets, it probably looks pretty good.

Please attach a screen shot or show me the bad scroll bar look.
Comment 9 Kaitlin Duck Sherwood CLA 2012-07-11 12:28:00 EDT
Created attachment 218581 [details]
With V_SCROLL, short text

Here is an example of the "empty scrollbars" looking ugly.

On Mac OS X 10.6.8 and SWT 3.7.2v3740f, if V_SCROLL is added, the scrollbars always show.

This is the line of code which produced this text box:

descriptionText = new Text(descriptionComposite, SWT.WRAP | SWT.READ_ONLY | SWT.V_SCROLL);
Comment 10 Kaitlin Duck Sherwood CLA 2012-07-11 12:30:30 EDT
Created attachment 218582 [details]
no V_SCROLL, no scrollbars ever

On Mac OS X 10.6.8 and SWT 3.7.2v3740f, if V_SCROLL not added, the scrollbars never show.

This is the line of text which produced the text box in this image:
   descriptionText = new Text(descriptionComposite, SWT.WRAP | SWT.READ_ONLY);

(The full text in the description is about twice as long as what shows.)
Comment 11 Markus Keller CLA 2012-07-11 19:12:21 EDT
Kate: In 3.8, you can use StyledText and call setAlwaysShowScrollBars(false).