Skip to content

Commit

Permalink
Merge branch '1.10.20.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
zeruth committed Jan 26, 2024
2 parents b8b78f9 + 1f2cc51 commit 90f747a
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 42 deletions.
2 changes: 1 addition & 1 deletion cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>net.runelite</groupId>
<artifactId>runelite-parent</artifactId>
<version>1.10.20.3</version>
<version>1.10.20.4</version>
</parent>

<artifactId>cache</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<groupId>net.runelite</groupId>
<artifactId>runelite-parent</artifactId>
<version>1.10.20.3</version>
<version>1.10.20.4</version>
<packaging>pom</packaging>

<name>RuneLite</name>
Expand Down Expand Up @@ -63,7 +63,7 @@
<url>https://github.com/runelite/runelite</url>
<connection>scm:git:git://github.com/runelite/runelite</connection>
<developerConnection>scm:git:[email protected]:runelite/runelite</developerConnection>
<tag>runelite-parent-1.10.20.3</tag>
<tag>runelite-parent-1.10.20.4</tag>
</scm>

<developers>
Expand Down
2 changes: 1 addition & 1 deletion runelite-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>net.runelite</groupId>
<artifactId>runelite-parent</artifactId>
<version>1.10.20.3</version>
<version>1.10.20.4</version>
</parent>

<artifactId>runelite-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion runelite-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>net.runelite</groupId>
<artifactId>runelite-parent</artifactId>
<version>1.10.20.3</version>
<version>1.10.20.4</version>
</parent>

<artifactId>client</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ JButton add(NavigationButton nb, boolean resize)
SwingUtil.removeButtonDecorations(jb);
jb.setToolTipText(nb.getTooltip());
jb.setFocusable(false);
jb.setPreferredSize(new Dimension(24, 24));
jb.setPreferredSize(new Dimension(23, 23));
jb.setAlignmentX(.5f);
jb.setAlignmentY(.5f);

Expand Down
17 changes: 13 additions & 4 deletions runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ private void applyCustomChromeBorder()
{
content.setBorder((frame.getExtendedState() & Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_BOTH
? null
: new MatteBorder(0, 4, 4, 4, ColorScheme.DARKER_GRAY_COLOR));
: new MatteBorder(4, 4, 4, 4, ColorScheme.DARKER_GRAY_COLOR));
}

public void show()
Expand Down Expand Up @@ -600,6 +600,15 @@ public void show()
frame.setBounds(clientBounds);
appliedSize = true;

// Adjust for insets before performing display test
Insets insets = frame.getInsets();
clientBounds = new Rectangle(
clientBounds.x + insets.left,
clientBounds.y + insets.top,
clientBounds.width - (insets.left + insets.right),
clientBounds.height - (insets.top + insets.bottom)
);

// Check that the bounds are contained inside a valid display
GraphicsConfiguration gc = findDisplayFromBounds(clientBounds);
if (gc == null)
Expand Down Expand Up @@ -1370,12 +1379,12 @@ private void layout(Container content, boolean forceSizingClient)
client.setBounds(insets.left, insets.top, clientWidth, innerHeight);
sidebar.setBounds(insets.left + clientWidth, insets.top, sidebarWidth, innerHeight);

Dimension oldSize = frame.getSize();
Rectangle oldBounds = frame.getBounds();
frame.revalidateMinimumSize();
if ((OSType.getOSType() != OSType.Windows || (changed & Frame.MAXIMIZED_BOTH) == 0)
&& !frame.getPreferredSize().equals(oldSize))
&& !frame.getPreferredSize().equals(oldBounds.getSize()))
{
frame.containedSetSize(frame.getPreferredSize(), oldSize);
frame.containedSetSize(frame.getPreferredSize(), oldBounds);
}

log.trace("finishing layout - content={} client={} sidebar={} frame={}", content.getWidth(), client.getWidth(), sidebar.getWidth(), frame.getWidth());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,79 +98,79 @@ public void pack()

// we must use the deprecated variants since that it what Component ultimately delegates to
@SuppressWarnings("deprecation")
private void applyChange(int x, int y, int width, int height, int oldX, int oldY, int oldWidth, boolean contain)
private void applyChange(int wX, int wY, int wWidth, int wHeight, int wOldx, int wOldY, int wOldWidth, boolean contain)
{
try
{
boundsOpSet = true;

if (contain && !isFullScreen())
{
Rectangle dpyBounds = this.getGraphicsConfiguration().getBounds();
Rectangle cDpyBounds = this.getGraphicsConfiguration().getBounds();
Insets insets = this.getInsets();
Rectangle rect = new Rectangle(x + insets.left, y + insets.top, width - (insets.left + insets.right), height - (insets.top + insets.bottom));
Rectangle cRect = new Rectangle(wX + insets.left, wY + insets.top, wWidth - (insets.left + insets.right), wHeight - (insets.top + insets.bottom));

if (rightSideSuction)
{
// only keep suction while where are near the screen edge
rightSideSuction = getBounds().getMaxX() + SCREEN_EDGE_CLOSE_DISTANCE >= dpyBounds.getMaxX();
rightSideSuction = wOldx + wOldWidth - insets.right + SCREEN_EDGE_CLOSE_DISTANCE >= cDpyBounds.getMaxX();
}

if (rightSideSuction && width < oldWidth)
if (rightSideSuction && wWidth < wOldWidth)
{
// shift the window so the right side is near the edge again
rect.x += oldWidth - width;
cRect.x += wOldWidth - wWidth;
}

if (width > oldWidth
&& rect.getMaxX() > dpyBounds.getMaxX()
&& oldX + oldWidth + SCREEN_EDGE_CLOSE_DISTANCE > dpyBounds.getMaxX()
&& oldX + oldWidth <= dpyBounds.getMaxX())
if (wWidth > wOldWidth
&& cRect.getMaxX() > cDpyBounds.getMaxX()
&& (wOldx + insets.left) + (wOldWidth - (insets.left + insets.right)) + SCREEN_EDGE_CLOSE_DISTANCE > cDpyBounds.getMaxX()
&& (wOldx + insets.left) + (wOldWidth - (insets.left + insets.right)) <= cDpyBounds.getMaxX())
{
// attempt to retain the distance between us and the edge when shifting left
rect.x -= width - oldWidth;
cRect.x -= wWidth - wOldWidth;
}

rect.x -= Math.max(0, rect.getMaxX() - dpyBounds.getMaxX());
rect.y -= Math.max(0, rect.getMaxY() - dpyBounds.getMaxY());
cRect.x -= Math.max(0, cRect.getMaxX() - cDpyBounds.getMaxX());
cRect.y -= Math.max(0, cRect.getMaxY() - cDpyBounds.getMaxY());

// if we are just resizing don't try to move the left side out
if (rect.x != oldX + insets.left)
if (cRect.x != wOldx + insets.left)
{
rect.x = Math.max(rect.x, dpyBounds.x);
cRect.x = Math.max(cRect.x, cDpyBounds.x);
}

if (rect.y != oldY + insets.top)
if (cRect.y != wOldY + insets.top)
{
rect.y = Math.max(rect.y, dpyBounds.y);
cRect.y = Math.max(cRect.y, cDpyBounds.y);
}

if (width > oldWidth && rect.x < x)
if (wWidth > wOldWidth && cRect.x < wOldx + insets.left)
{
// we have shifted the window left to avoid the right side going oob
rightSideSuction = true;
}

x = rect.x - insets.left;
y = rect.y - insets.top;
width = rect.width + insets.left + insets.right;
height = rect.height + insets.top + insets.bottom;
wX = cRect.x - insets.left;
wY = cRect.y - insets.top;
wWidth = cRect.width + insets.left + insets.right;
wHeight = cRect.height + insets.top + insets.bottom;
}

boolean xyDifferent = getX() != x || getY() != y;
boolean whDifferent = getWidth() != width || getHeight() != height;
boolean xyDifferent = getX() != wX || getY() != wY;
boolean whDifferent = getWidth() != wWidth || getHeight() != wHeight;

if (xyDifferent && whDifferent)
{
super.reshape(x, y, width, height);
super.reshape(wX, wY, wWidth, wHeight);
}
else if (xyDifferent)
{
super.move(x, y);
super.move(wX, wY);
}
else if (whDifferent)
{
super.resize(width, height);
super.resize(wWidth, wHeight);
}
}
finally
Expand All @@ -182,10 +182,10 @@ else if (whDifferent)
/**
* Adjust the frame's size, containing to the screen if {@code Mode.RESIZING} is set
*/
public void containedSetSize(Dimension size, Dimension oldSize)
public void containedSetSize(Dimension size, Rectangle oldBounds)
{
// accept oldSize from the outside since the min size might have been set, which forces the size to change
applyChange(getX(), getY(), size.width, size.height, getX(), getY(), oldSize.width, this.containedInScreen != Mode.NEVER);
applyChange(getX(), getY(), size.width, size.height, oldBounds.x, oldBounds.y, oldBounds.width, this.containedInScreen != Mode.NEVER);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ TitlePane.background=@DARKER_GRAY
TitlePane.unifiedBackground=false
TitlePane.useWindowDecorations=false
TitlePane.font=bold
TitlePane.buttonSize = 33,27
TitlePane.buttonSize=33,23

ToolBar.background=@DARKER_GRAY

Expand Down
2 changes: 1 addition & 1 deletion runelite-jshell/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<parent>
<groupId>net.runelite</groupId>
<artifactId>runelite-parent</artifactId>
<version>1.10.20.3</version>
<version>1.10.20.4</version>
</parent>

<artifactId>jshell</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion runelite-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>net.runelite</groupId>
<artifactId>runelite-parent</artifactId>
<version>1.10.20.3</version>
<version>1.10.20.4</version>
</parent>

<artifactId>runelite-maven-plugin</artifactId>
Expand Down

0 comments on commit 90f747a

Please sign in to comment.