Skip to content

Commit

Permalink
set dialog minimum height to preferred height (or make resizable) to …
Browse files Browse the repository at this point in the history
…avoid window sizing bug in some linux environments
  • Loading branch information
craigraw committed Nov 14, 2023
1 parent a531237 commit 9391a39
Show file tree
Hide file tree
Showing 21 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/sparrowwallet/sparrow/WelcomeDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public WelcomeDialog() {

dialogPane.setPrefWidth(600);
dialogPane.setPrefHeight(520);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

dialogPane.getStylesheets().add(AppServices.class.getResource("welcome.css").toExternalForm());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public DeviceDialog(List<String> operationFingerprints) {

dialogPane.setPrefWidth(500);
dialogPane.setPrefHeight(360);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

setResultConverter(dialogButton -> dialogButton == cancelButtonType ? null : getResult());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public void onChanged(Change<? extends TablePosition> c) {

dialogPane.setPrefWidth(952);
dialogPane.setPrefHeight(500);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.setStageIcon(dialogPane.getScene().getWindow());
AppServices.moveToActiveWindowScreen(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public QRDisplayDialog(UR ur, boolean addLegacyEncodingOption, boolean addScanBu

dialogPane.setPrefWidth(40 + qrSize + 40);
dialogPane.setPrefHeight(40 + qrSize + 85);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

setResultConverter(dialogButton -> dialogButton);
Expand Down Expand Up @@ -143,6 +144,7 @@ public QRDisplayDialog(String data, boolean addScanButton) {

dialogPane.setPrefWidth(40 + qrSize + 40);
dialogPane.setPrefHeight(40 + qrSize + 85);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

setResultConverter(dialogButton -> dialogButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ public QRScanDialog() {
dialogPane.getButtonTypes().addAll(hdButtonType, camButtonType, cancelButtonType);
dialogPane.setPrefWidth(646);
dialogPane.setPrefHeight(webcamResolutionProperty.get() == WebcamResolution.HD ? 490 : 590);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

setResultConverter(dialogButton -> dialogButton != cancelButtonType ? result : null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public void pasteClipboard() {

dialogPane.setPrefWidth(850);
dialogPane.setPrefHeight(500);
setResizable(true);
AppServices.setStageIcon(dialogPane.getScene().getWindow());
AppServices.moveToActiveWindowScreen(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public TextAreaDialog(@NamedArg("defaultValue") String defaultValue, @NamedArg("

dialogPane.setPrefWidth(700);
dialogPane.setPrefHeight(400);
setResizable(true);
AppServices.moveToActiveWindowScreen(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public WalletExportDialog(Wallet wallet) {
dialogPane.getButtonTypes().addAll(cancelButtonType);
dialogPane.setPrefWidth(500);
dialogPane.setPrefHeight(480);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

setResultConverter(dialogButton -> dialogButton != cancelButtonType ? wallet : null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public WalletImportDialog(List<WalletForm> selectedWalletForms) {

dialogPane.setPrefWidth(500);
dialogPane.setPrefHeight(600);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

setResultConverter(dialogButton -> dialogButton != cancelButtonType ? wallet : null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public WalletSummaryDialog(List<WalletForm> walletForms) {
ButtonType okButtonType = new javafx.scene.control.ButtonType("Done", ButtonBar.ButtonData.OK_DONE);
dialogPane.getButtonTypes().addAll(okButtonType);

setResizable(true);
AppServices.moveToActiveWindowScreen(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public KeystoreImportDialog(Wallet wallet, KeystoreSource initialSource, KeyDeri
dialogPane.getButtonTypes().add(cancelButtonType);
dialogPane.setPrefWidth(650);
dialogPane.setPrefHeight(690);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

setResultConverter(dialogButton -> dialogButton != cancelButtonType ? getWatchOnlyKeystore() : null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public PayNymAddressesDialog(WalletForm walletForm) {

dialogPane.setPrefWidth(800);
dialogPane.setPrefHeight(600);
dialogPane.setMinHeight(dialogPane.getPrefHeight());

setResizable(true);
} catch(IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public PayNymDialog(String walletId, Operation operation, boolean selectLinkedOn

dialogPane.setPrefWidth(730);
dialogPane.setPrefHeight(600);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

dialogPane.getStylesheets().add(AppServices.class.getResource("app.css").toExternalForm());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public PreferencesDialog(PreferenceGroup initialGroup, boolean initialSetup) {

dialogPane.setPrefWidth(750);
dialogPane.setPrefHeight(630);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

preferencesController.reconnectOnClosingProperty().set(AppServices.isConnecting() || AppServices.isConnected());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public ServerAliasDialog(ServerType serverType) {

dialogPane.setPrefWidth(680);
dialogPane.setPrefHeight(500);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.setStageIcon(dialogPane.getScene().getWindow());
AppServices.moveToActiveWindowScreen(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public CounterpartyDialog(String walletId, Wallet wallet) {

dialogPane.setPrefWidth(730);
dialogPane.setPrefHeight(520);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

dialogPane.getStylesheets().add(AppServices.class.getResource("app.css").toExternalForm());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public InitiatorDialog(String walletId, Wallet wallet, WalletTransaction walletT

dialogPane.setPrefWidth(730);
dialogPane.setPrefHeight(530);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

dialogPane.getStylesheets().add(AppServices.class.getResource("general.css").toExternalForm());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public AdvancedDialog(WalletForm walletForm) {

dialogPane.setPrefWidth(400);
dialogPane.setPrefHeight(300);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

setOnCloseRequest(event -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public MixToDialog(Wallet wallet) {

dialogPane.setPrefWidth(400);
dialogPane.setPrefHeight(300);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

setResultConverter(dialogButton -> dialogButton == applyButtonType ? mixToController.getMixConfig() : null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public MultisigBackupDialog(Wallet wallet, String descriptor, UR ur) {

dialogPane.setPrefWidth(700);
dialogPane.setPrefHeight(500);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public WhirlpoolDialog(String walletId, Wallet wallet, List<UtxoEntry> utxoEntri

dialogPane.setPrefWidth(600);
dialogPane.setPrefHeight(570);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this);

dialogPane.getStylesheets().add(AppServices.class.getResource("app.css").toExternalForm());
Expand Down

0 comments on commit 9391a39

Please sign in to comment.