From 704b9b5d03b424826f65d3a8331c7cba4bde83cb Mon Sep 17 00:00:00 2001 From: weisj Date: Tue, 24 Mar 2020 18:11:46 +0100 Subject: [PATCH] Only fetch border once rather than each time. --- .../weisj/darklaf/components/border/DarkBorders.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/github/weisj/darklaf/components/border/DarkBorders.java b/core/src/main/java/com/github/weisj/darklaf/components/border/DarkBorders.java index 06c3c7e2..cc1174c0 100644 --- a/core/src/main/java/com/github/weisj/darklaf/components/border/DarkBorders.java +++ b/core/src/main/java/com/github/weisj/darklaf/components/border/DarkBorders.java @@ -25,6 +25,7 @@ package com.github.weisj.darklaf.components.border; import javax.swing.*; import javax.swing.border.Border; +import java.awt.*; import java.util.Map; import java.util.WeakHashMap; @@ -61,11 +62,13 @@ public final class DarkBorders { } public static void update(final UIDefaults defaults) { + Color borderColor = defaults.getColor("border"); for (WeakLineBorder border : lineBorderMap.values()) { - border.setColor(defaults.getColor("border")); + border.setColor(borderColor); } + Color borderSecondaryColor = defaults.getColor("borderSecondary"); for (WeakLineBorder border : lineWidgetBorderMap.values()) { - border.setColor(defaults.getColor("border")); + border.setColor(borderSecondaryColor); } } }