mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 12:46:45 +00:00
save app width and height across restarts
This commit is contained in:
parent
90355a653f
commit
a3e4342d7d
2 changed files with 27 additions and 0 deletions
|
@ -90,6 +90,11 @@ public class MainApp extends Application {
|
|||
|
||||
System.setProperty(Wallet.ALLOW_DERIVATIONS_MATCHING_OTHER_SCRIPT_TYPES_PROPERTY, Boolean.toString(!Config.get().isValidateDerivationPaths()));
|
||||
|
||||
if(Config.get().getAppHeight() != null && Config.get().getAppWidth() != null) {
|
||||
mainStage.setWidth(Config.get().getAppWidth());
|
||||
mainStage.setHeight(Config.get().getAppHeight());
|
||||
}
|
||||
|
||||
AppController appController = AppServices.newAppWindow(stage);
|
||||
|
||||
if(createNewWallet) {
|
||||
|
@ -119,6 +124,8 @@ public class MainApp extends Application {
|
|||
@Override
|
||||
public void stop() throws Exception {
|
||||
AppServices.get().stop();
|
||||
Config.get().setAppWidth(mainStage.getWidth());
|
||||
Config.get().setAppHeight(mainStage.getHeight());
|
||||
mainStage.close();
|
||||
if(sparrowInstance != null) {
|
||||
sparrowInstance.freeLock();
|
||||
|
|
|
@ -57,6 +57,8 @@ public class Config {
|
|||
private File electrumServerCert;
|
||||
private boolean useProxy;
|
||||
private String proxyServer;
|
||||
private Double appWidth;
|
||||
private Double appHeight;
|
||||
private String scode;
|
||||
|
||||
private static Config INSTANCE;
|
||||
|
@ -458,6 +460,24 @@ public class Config {
|
|||
flush();
|
||||
}
|
||||
|
||||
public Double getAppWidth() {
|
||||
return appWidth;
|
||||
}
|
||||
|
||||
public void setAppWidth(Double appWidth) {
|
||||
this.appWidth = appWidth;
|
||||
flush();
|
||||
}
|
||||
|
||||
public Double getAppHeight() {
|
||||
return appHeight;
|
||||
}
|
||||
|
||||
public void setAppHeight(Double appHeight) {
|
||||
this.appHeight = appHeight;
|
||||
flush();
|
||||
}
|
||||
|
||||
public String getScode() {
|
||||
return scode;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue