diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/ui/RadianceScrollBarUI.java b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/ui/RadianceScrollBarUI.java index 9ffde9fdd..e1a8d07b2 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/ui/RadianceScrollBarUI.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/ui/RadianceScrollBarUI.java @@ -347,13 +347,7 @@ protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds) { } RadianceSkin skin = RadianceCoreUtilities.getSkin(this.scrollbar); if (skin instanceof TonalSkin) { - Color backgroundFill = RadianceColorSchemeUtilities.getRenderColorTokens( - this.scrollbar, - this.scrollbar.isEnabled() ? ComponentState.ENABLED : - ComponentState.DISABLED_UNSELECTED, - RadianceThemingSlices.ContainerType.NEUTRAL) - .getContainerColorTokens().getContainer(); - graphics.setColor(backgroundFill); + graphics.setColor(RadianceColorUtilities.getBackgroundTonalFillColorScrollBar(this.scrollbar)); } else { graphics.setColor(RadianceColorUtilities.getBackgroundFillColorScrollBar(this.scrollbar)); } diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/ui/RadianceScrollPaneUI.java b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/ui/RadianceScrollPaneUI.java index 73290b0c7..bebfa4c2c 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/ui/RadianceScrollPaneUI.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/ui/RadianceScrollPaneUI.java @@ -32,7 +32,6 @@ import org.pushingpixels.radiance.animation.api.Timeline; import org.pushingpixels.radiance.animation.api.swing.EventDispatchThreadTimelineCallbackAdapter; import org.pushingpixels.radiance.animation.api.swing.SwingComponentTimeline; -import org.pushingpixels.radiance.theming.api.ComponentState; import org.pushingpixels.radiance.theming.api.RadianceSkin; import org.pushingpixels.radiance.theming.api.RadianceThemingSlices; import org.pushingpixels.radiance.theming.api.RadianceThemingWidget; @@ -40,7 +39,6 @@ import org.pushingpixels.radiance.theming.internal.AnimationConfigurationManager; import org.pushingpixels.radiance.theming.internal.RadianceThemingWidgetRepository; import org.pushingpixels.radiance.theming.internal.painter.BackgroundPaintingUtils; -import org.pushingpixels.radiance.theming.internal.utils.RadianceColorSchemeUtilities; import org.pushingpixels.radiance.theming.internal.utils.RadianceColorUtilities; import org.pushingpixels.radiance.theming.internal.utils.RadianceCoreUtilities; @@ -284,13 +282,8 @@ public void update(Graphics g, JComponent c) { Graphics2D g2d = (Graphics2D) g.create(); RadianceSkin skin = RadianceCoreUtilities.getSkin(this.scrollpane); if (skin instanceof TonalSkin) { - Color backgroundFill = RadianceColorSchemeUtilities.getRenderColorTokens( - this.scrollpane.getVerticalScrollBar(), - this.scrollpane.isEnabled() ? ComponentState.ENABLED : - ComponentState.DISABLED_UNSELECTED, - RadianceThemingSlices.ContainerType.NEUTRAL) - .getContainerColorTokens().getContainer(); - g2d.setColor(backgroundFill); + g2d.setColor(RadianceColorUtilities.getBackgroundTonalFillColorScrollBar( + this.scrollpane.getVerticalScrollBar())); } else { g2d.setColor(RadianceColorUtilities.getBackgroundFillColorScrollBar( this.scrollpane.getVerticalScrollBar())); diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/RadianceColorUtilities.java b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/RadianceColorUtilities.java index 060fa4b82..170f0add7 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/RadianceColorUtilities.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/RadianceColorUtilities.java @@ -855,12 +855,11 @@ public static Color getBackgroundFillColorScrollBar(JScrollBar scrollbar) { } public static Color getBackgroundTonalFillColorScrollBar(JScrollBar scrollbar) { - RadianceSkin skin = RadianceCoreUtilities.getSkin(scrollbar); - RadianceColorUtilities.getTonalBackgroundFillColor(scrollbar, + ContainerRenderColorTokens colorTokens = RadianceColorSchemeUtilities.getRenderColorTokens( + scrollbar, + scrollbar.isEnabled() ? ComponentState.ENABLED : ComponentState.DISABLED_UNSELECTED, RadianceThemingSlices.ContainerType.NEUTRAL); - ExtendedContainerRenderColorTokens renderColorTokens = - skin.getBackgroundRenderColorTokens(DecorationPainterUtils.getDecorationType(scrollbar)); - return renderColorTokens.getSurfaceContainerTokens().getContainerColorTokens().getContainerLow(); + return colorTokens.getContainerColorTokens().getContainer(); } /**