Skip to content

Commit b251ebc

Browse files
authored
Remember Sidepane width after restart (#8936)
1 parent 1301384 commit b251ebc

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
5151
- We fixed an issue where the exception that there are invalid characters in filename. [#8786](https://github.com/JabRef/jabref/issues/8786)
5252
- When the proxy configuration removed the proxy user/password, this change is applied immediately.
5353
- We fixed an issue where removing several groups deletes only one of them. [#8390](https://github.com/JabRef/jabref/issues/8390)
54+
- We fixed an issue where the Sidepane(groups, web search and open office) width is not remembered after restarting JabRef. [#8907](https://github.com/JabRef/jabref/issues/8907)
5455
- We fixed a bug where switching between themes will cause an error/exception. [#8939](https://github.com/JabRef/jabref/pull/8939)
5556

5657
### Removed

src/main/java/org/jabref/gui/JabRefFrame.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,10 @@ private void initLayout() {
448448
@Override
449449
public void invalidated(Observable observable) {
450450
if (mainStage.isShowing()) {
451-
setDividerPosition();
452-
observable.removeListener(this);
451+
Platform.runLater(() -> {
452+
setDividerPosition();
453+
observable.removeListener(this);
454+
});
453455
}
454456
}
455457
});
@@ -472,10 +474,9 @@ private void updateSidePane() {
472474
}
473475

474476
private void setDividerPosition() {
475-
splitPane.setDividerPositions(prefs.getGuiPreferences().getSidePaneWidth());
476477
if (mainStage.isShowing() && !sidePane.getChildren().isEmpty()) {
477-
dividerSubscription = EasyBind.subscribe(splitPane.getDividers().get(0).positionProperty(),
478-
position -> prefs.getGuiPreferences().setSidePaneWidth(position.doubleValue()));
478+
splitPane.setDividerPositions(prefs.getGuiPreferences().getSidePaneWidth() / splitPane.getWidth());
479+
dividerSubscription = EasyBind.subscribe(sidePane.widthProperty(), width -> prefs.getGuiPreferences().setSidePaneWidth(width.doubleValue()));
479480
}
480481
}
481482

0 commit comments

Comments
 (0)