Remember the window's place and the tree/chat divider

The main window comes back at its last size and position, maximised if it was;
a place no longer on any screen falls back to the default. The tree/chat
divider is saved like the tree/info one, and both keep their share of the
window as it is resized.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 01:30:14 +00:00
co-authored by Claude Opus 5.5
parent a57700959f
commit b7a5828c43
5 changed files with 172 additions and 32 deletions
@@ -198,6 +198,11 @@ public final class Settings {
public boolean showMasterVolumeSlider = true;
/** Share of the tree/info column the tree takes, i.e. where their divider sits. */
public double infoSplitRatio = 0.68;
/** Share of the window's width the tree/info column takes, beside the chat. */
public double chatSplitRatio = 0.45;
/** The main window's bounds when not maximised; a width of 0 until it has been placed. */
public int windowX, windowY, windowWidth, windowHeight;
public boolean windowMaximized;
/** Whether the ban list shows the bans we created ourselves in bold. */
public boolean banHighlightOwn = true;
/** The ban list columns the user shows, comma-separated column names; empty for the default set. */
@@ -323,6 +328,12 @@ public final class Settings {
showStatusBar = parseB(props.getProperty("showStatusBar"), showStatusBar);
showMasterVolumeSlider = parseB(props.getProperty("showMasterVolumeSlider"), showMasterVolumeSlider);
infoSplitRatio = parseD(props.getProperty("infoSplitRatio"), infoSplitRatio);
chatSplitRatio = parseD(props.getProperty("chatSplitRatio"), chatSplitRatio);
windowX = parseI(props.getProperty("windowX"), windowX);
windowY = parseI(props.getProperty("windowY"), windowY);
windowWidth = parseI(props.getProperty("windowWidth"), windowWidth);
windowHeight = parseI(props.getProperty("windowHeight"), windowHeight);
windowMaximized = parseB(props.getProperty("windowMaximized"), windowMaximized);
banHighlightOwn = parseB(props.getProperty("banHighlightOwn"), banHighlightOwn);
banListColumns = props.getProperty("banListColumns", banListColumns);
notifications.load(props);
@@ -385,6 +396,12 @@ public final class Settings {
props.setProperty("showStatusBar", Boolean.toString(showStatusBar));
props.setProperty("showMasterVolumeSlider", Boolean.toString(showMasterVolumeSlider));
props.setProperty("infoSplitRatio", Double.toString(infoSplitRatio));
props.setProperty("chatSplitRatio", Double.toString(chatSplitRatio));
props.setProperty("windowX", Integer.toString(windowX));
props.setProperty("windowY", Integer.toString(windowY));
props.setProperty("windowWidth", Integer.toString(windowWidth));
props.setProperty("windowHeight", Integer.toString(windowHeight));
props.setProperty("windowMaximized", Boolean.toString(windowMaximized));
props.setProperty("banHighlightOwn", Boolean.toString(banHighlightOwn));
props.setProperty("banListColumns", banListColumns);
notifications.store(props);