feat(io): widen GUI sidebar and drop its max-width cap
Give the map/quests sidebar more room: raise the width fraction (0.28 -> 0.34) and minimum (180 -> 220), and remove the SIDE_MAX upper clamp so the panel keeps scaling with the window instead of stopping at 460px. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -69,10 +69,9 @@ public class SwingIO implements GameIO {
|
|||||||
/** Delay between rooms while animating a go-to auto-walk, in milliseconds. */
|
/** Delay between rooms while animating a go-to auto-walk, in milliseconds. */
|
||||||
private static final long TRAVEL_STEP_MS = 300L;
|
private static final long TRAVEL_STEP_MS = 300L;
|
||||||
|
|
||||||
/** Side-panel width as a fraction of the window width, clamped by the bounds below. */
|
/** Side-panel width as a fraction of the window width, with a lower bound only. */
|
||||||
private static final double SIDE_RATIO = 0.28;
|
private static final double SIDE_RATIO = 0.34;
|
||||||
private static final int SIDE_MIN = 180;
|
private static final int SIDE_MIN = 220;
|
||||||
private static final int SIDE_MAX = 460;
|
|
||||||
|
|
||||||
private final MusicController music = new MusicController(new OggMusicBackend());
|
private final MusicController music = new MusicController(new OggMusicBackend());
|
||||||
private final LinkedBlockingQueue<String> inputs = new LinkedBlockingQueue<>();
|
private final LinkedBlockingQueue<String> inputs = new LinkedBlockingQueue<>();
|
||||||
@@ -191,11 +190,10 @@ public class SwingIO implements GameIO {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sizes the side panel to a fraction of the window width, clamped to [min, max] (scaled). */
|
/** Sizes the side panel to a fraction of the window width, with a scaled lower bound. */
|
||||||
private void updateSideWidth() {
|
private void updateSideWidth() {
|
||||||
int min = (int) (SIDE_MIN * uiScale);
|
int min = (int) (SIDE_MIN * uiScale);
|
||||||
int max = (int) (SIDE_MAX * uiScale);
|
int target = Math.max(min, (int) (frame.getWidth() * SIDE_RATIO));
|
||||||
int target = Math.max(min, Math.min(max, (int) (frame.getWidth() * SIDE_RATIO)));
|
|
||||||
sidePanel.setPreferredSize(new Dimension(target, 0));
|
sidePanel.setPreferredSize(new Dimension(target, 0));
|
||||||
questScroll.setPreferredSize(new Dimension(target, (int) (frame.getHeight() * 0.32)));
|
questScroll.setPreferredSize(new Dimension(target, (int) (frame.getHeight() * 0.32)));
|
||||||
sidePanel.revalidate();
|
sidePanel.revalidate();
|
||||||
|
|||||||
Reference in New Issue
Block a user