SetOpaque performance fix

Apparently, the setOpaque method on JPanels was causing some performance
issues on the client, the original reason I had these was so that the
base panel would have a color defined, and every container or wrapper
panel on top would just be transparent.

To fix this I have set a default JPanel background color and replaced
calls to setOpaque with calls to
setBackground with the appropriate colors.
This commit is contained in:
Ruben Amendoeira
2018-05-19 18:55:07 +01:00
parent 23395b6d48
commit 6c18bcb6bf
15 changed files with 25 additions and 38 deletions

View File

@@ -62,6 +62,7 @@ import javax.swing.UnsupportedLookAndFeelException;
import static javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE;
import javax.swing.plaf.FontUIResource;
import lombok.extern.slf4j.Slf4j;
import net.runelite.client.ui.ColorScheme;
import net.runelite.client.ui.NavigationButton;
import net.runelite.client.ui.components.CustomScrollBarUI;
import org.pushingpixels.substance.internal.SubstanceSynapse;
@@ -87,6 +88,7 @@ public class SwingUtil
UIManager.put("Button.foreground", Color.WHITE);
UIManager.put("MenuItem.foreground", Color.WHITE);
UIManager.put("Panel.background", ColorScheme.DARK_GRAY_COLOR);
UIManager.put("ScrollBarUI", CustomScrollBarUI.class.getName());
// Do not render shadows under popups/tooltips.