RFR: 7175397: The divider color is not changed to green when dragging for Nimbus LaF. [v2]

Jayathirth D V jdv at openjdk.org
Wed Sep 28 12:08:24 UTC 2022


On Wed, 24 Aug 2022 04:21:26 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> SplitPaneDivider.draggingColor UIProperty was not honoured in Nimbus L&F. 
>> Added support for setting SplitPane dragging color for Nimbus L&F by drawing a fillRect of the set color as done in BasicLookAndFeel.
>> The fix relies on `continuousLayout` property being false by default which is enabled for Nimbus, which is set to default false now, same as in other L&F. I think it was set true just to have documented default value in JDK-6937415
>> 
>> closed test mentioned in JBS is used for fix check.
>> All jtreg swing tests are ok along with SwingSet2 JSplitPane demo in Nimbus L&F.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revert default value

Changes requested by jdv (Reviewer).

src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java line 273:

> 271:                 paintDragDivider(g, 0, 0, getWidth(), getHeight());
> 272:                 if(!isContinuousLayout() && getLastDragLocation() != -1) {
> 273:                     Dimension      size = splitPane.getSize();

We can eliminate creation on new variable and use splitPane.getWidth/Height() as it is done at many places in this file.

src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java line 352:

> 350:         Shape oldClip = g.getClip();
> 351:         g.clipRect(x, y, w, h);
> 352: 

Please remove these new lines

src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java line 366:

> 364:         if(jc == splitPane && getLastDragLocation() != -1 &&
> 365:                               !isContinuousLayout() && !draggingHW) {
> 366:             Dimension      size = splitPane.getSize();

Same here

-------------

PR: https://git.openjdk.org/jdk/pull/9937



More information about the client-libs-dev mailing list