United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6478904 GTK L&F: scrollbars rendered incorrectly under Nimbus theme
JDK-6478904 : GTK L&F: scrollbars rendered incorrectly under Nimbus theme

Details
Type:
Bug
Submit Date:
2006-10-05
Status:
Closed
Updated Date:
2011-03-09
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
client-libs
OS:
solaris_9
Sub-Component:
javax.swing
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:

Related Reports
Backport:
Relates:

Sub Tasks

Description
There are a few problems with scrollbars when used with Swing's GTK L&F and the
Nimbus theme on Solaris:
  1) The top and left buttons have an extra border on the top/left side.
  2) The bottom and right buttons look okay in the normal state, but are not
     rendered properly for the rollover or pressed states (they just look like
     the normal state in those cases).
  3) The scroll thumb does not align properly when positioned at either end of the
     trough (it appears to sit above the end of the arrow button).

                                    

Comments
EVALUATION

1,2) It appears that the Nimbus engine has some special hacks to deal with
scrollbars in FireFox, and Swing's GTK L&F is hitting that case, which causes
the top/left scroll button to be offset by a couple pixels and the bottom/right
scroll button to be not rendered at all.  Will need to discuss this further
with the engineer responsible for Nimbus.

3) Under Nimbus, the scrollbar buttons are rectangular (e.g. 13x17 for a vertical
scrollbar).  However, the GTK L&F is currently assuming that scrollbar buttons
will be square (we set the ScrollBar.squareButtons property to TRUE).  Also, in
SynthArrowButton, we only use the ArrowButton.size property to determine both the
width and height of arrow buttons, and we're getting that size value from
GtkRange's "slider-width" style property.  This means that currently we are
creating arrow buttons under Nimbus that are 13x13, and as a result the scrollbar
thumb is free to paint over the ends of the trough.  I propose that we fix
this by introducing a new UI default, ScrollBar.buttonSize, the value of which
is a dimension that depends on the orientation of the scrollbar.  We can use
"slider-width" to determine the width and "stepper-size" for the height of
vertical scrollbar buttons, and vice versa for horizontal ones.  We can use
these values in SynthArrowButton.getPreferredSize() to create a rectangular
button.  We'll also have to change the default value of ScrollBar.squareButtons
property to FALSE in GTKLookAndFeel.
                                     
2006-10-05
EVALUATION

Issues (1) and (2) from above are most likely bugs in the Nimbus engine itself
and will be fixed as a Nimbus bug (bugid is 6483073); there's not much we can do
from Swing to resolve those issues.  However, issue (3) is something we can fix
easily in Swing.
                                     
2006-10-17



Hardware and Software, Engineered to Work Together