mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06: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()));
|
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);
|
AppController appController = AppServices.newAppWindow(stage);
|
||||||
|
|
||||||
if(createNewWallet) {
|
if(createNewWallet) {
|
||||||
|
@ -119,6 +124,8 @@ public class MainApp extends Application {
|
||||||
@Override
|
@Override
|
||||||
public void stop() throws Exception {
|
public void stop() throws Exception {
|
||||||
AppServices.get().stop();
|
AppServices.get().stop();
|
||||||
|
Config.get().setAppWidth(mainStage.getWidth());
|
||||||
|
Config.get().setAppHeight(mainStage.getHeight());
|
||||||
mainStage.close();
|
mainStage.close();
|
||||||
if(sparrowInstance != null) {
|
if(sparrowInstance != null) {
|
||||||
sparrowInstance.freeLock();
|
sparrowInstance.freeLock();
|
||||||
|
|
|
@ -57,6 +57,8 @@ public class Config {
|
||||||
private File electrumServerCert;
|
private File electrumServerCert;
|
||||||
private boolean useProxy;
|
private boolean useProxy;
|
||||||
private String proxyServer;
|
private String proxyServer;
|
||||||
|
private Double appWidth;
|
||||||
|
private Double appHeight;
|
||||||
private String scode;
|
private String scode;
|
||||||
|
|
||||||
private static Config INSTANCE;
|
private static Config INSTANCE;
|
||||||
|
@ -458,6 +460,24 @@ public class Config {
|
||||||
flush();
|
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() {
|
public String getScode() {
|
||||||
return scode;
|
return scode;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue