Merge pull request #2654 from Lucwousin/borderless-mode

client: Add windowed borderless to "RuneLite" config
This commit is contained in:
Owain van Brakel
2020-06-03 07:18:39 +02:00
committed by GitHub
2 changed files with 21 additions and 3 deletions

View File

@@ -112,6 +112,19 @@ public interface RuneLiteConfig extends Config
return true;
}
@ConfigItem(
keyName = "borderless",
name = "Windowed borderless",
description = "Use windowed borderless mode",
warning = "Please restart your client after changing this setting",
position = 6, // I don't want to change all numbers and this moves it below the other 6, fight me
titleSection = "uiTitle"
)
default boolean borderless()
{
return false;
}
@ConfigItem(
keyName = "usernameInTitle",
name = "Show display name in title",

View File

@@ -36,7 +36,6 @@ import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import static java.awt.GraphicsDevice.WindowTranslucency.TRANSLUCENT;
import java.awt.GraphicsEnvironment;
import java.awt.LayoutManager;
import java.awt.Rectangle;
@@ -61,7 +60,6 @@ import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import static javax.swing.JOptionPane.INFORMATION_MESSAGE;
import javax.swing.JPanel;
import javax.swing.JRootPane;
import javax.swing.SwingUtilities;
@@ -99,6 +97,8 @@ import net.runelite.client.util.WinUtil;
import org.pushingpixels.substance.internal.SubstanceSynapse;
import org.pushingpixels.substance.internal.utils.SubstanceCoreUtilities;
import org.pushingpixels.substance.internal.utils.SubstanceTitlePaneUtilities;
import static java.awt.GraphicsDevice.WindowTranslucency.TRANSLUCENT;
import static javax.swing.JOptionPane.INFORMATION_MESSAGE;
/**
* Client UI.
@@ -432,7 +432,8 @@ public class ClientUI
// Decorate window with custom chrome and titlebar if needed
withTitleBar = config.enableCustomChrome();
frame.setUndecorated(withTitleBar);
final boolean borderless = config.borderless();
frame.setUndecorated(withTitleBar | borderless);
if (withTitleBar)
{
@@ -480,6 +481,10 @@ public class ClientUI
}
});
}
else if (borderless)
{
frame.getRootPane().setWindowDecorationStyle(JRootPane.NONE);
}
// Update config
updateFrameConfig(true);