set dialog minimum height to preferred height (or make resizable) to avoid window sizing bug in some linux environments

This commit is contained in:
Craig Raw 2023-11-14 14:29:28 +02:00
parent a5312374a8
commit 9391a397da
21 changed files with 22 additions and 0 deletions

View file

@ -22,6 +22,7 @@ public class WelcomeDialog extends Dialog<Mode> {
dialogPane.setPrefWidth(600); dialogPane.setPrefWidth(600);
dialogPane.setPrefHeight(520); dialogPane.setPrefHeight(520);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
dialogPane.getStylesheets().add(AppServices.class.getResource("welcome.css").toExternalForm()); dialogPane.getStylesheets().add(AppServices.class.getResource("welcome.css").toExternalForm());

View file

@ -91,6 +91,7 @@ public abstract class DeviceDialog<R> extends Dialog<R> {
dialogPane.setPrefWidth(500); dialogPane.setPrefWidth(500);
dialogPane.setPrefHeight(360); dialogPane.setPrefHeight(360);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
setResultConverter(dialogButton -> dialogButton == cancelButtonType ? null : getResult()); setResultConverter(dialogButton -> dialogButton == cancelButtonType ? null : getResult());

View file

@ -139,6 +139,7 @@ public class MnemonicGridDialog extends Dialog<List<String>> {
dialogPane.setPrefWidth(952); dialogPane.setPrefWidth(952);
dialogPane.setPrefHeight(500); dialogPane.setPrefHeight(500);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.setStageIcon(dialogPane.getScene().getWindow()); AppServices.setStageIcon(dialogPane.getScene().getWindow());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
} }

View file

@ -109,6 +109,7 @@ public class QRDisplayDialog extends Dialog<ButtonType> {
dialogPane.setPrefWidth(40 + qrSize + 40); dialogPane.setPrefWidth(40 + qrSize + 40);
dialogPane.setPrefHeight(40 + qrSize + 85); dialogPane.setPrefHeight(40 + qrSize + 85);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
setResultConverter(dialogButton -> dialogButton); setResultConverter(dialogButton -> dialogButton);
@ -143,6 +144,7 @@ public class QRDisplayDialog extends Dialog<ButtonType> {
dialogPane.setPrefWidth(40 + qrSize + 40); dialogPane.setPrefWidth(40 + qrSize + 40);
dialogPane.setPrefHeight(40 + qrSize + 85); dialogPane.setPrefHeight(40 + qrSize + 85);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
setResultConverter(dialogButton -> dialogButton); setResultConverter(dialogButton -> dialogButton);

View file

@ -173,6 +173,7 @@ public class QRScanDialog extends Dialog<QRScanDialog.Result> {
dialogPane.getButtonTypes().addAll(hdButtonType, camButtonType, cancelButtonType); dialogPane.getButtonTypes().addAll(hdButtonType, camButtonType, cancelButtonType);
dialogPane.setPrefWidth(646); dialogPane.setPrefWidth(646);
dialogPane.setPrefHeight(webcamResolutionProperty.get() == WebcamResolution.HD ? 490 : 590); dialogPane.setPrefHeight(webcamResolutionProperty.get() == WebcamResolution.HD ? 490 : 590);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
setResultConverter(dialogButton -> dialogButton != cancelButtonType ? result : null); setResultConverter(dialogButton -> dialogButton != cancelButtonType ? result : null);

View file

@ -81,6 +81,7 @@ public class SendToManyDialog extends Dialog<List<Payment>> {
dialogPane.setPrefWidth(850); dialogPane.setPrefWidth(850);
dialogPane.setPrefHeight(500); dialogPane.setPrefHeight(500);
setResizable(true);
AppServices.setStageIcon(dialogPane.getScene().getWindow()); AppServices.setStageIcon(dialogPane.getScene().getWindow());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
} }

View file

@ -85,6 +85,7 @@ public class TextAreaDialog extends Dialog<String> {
dialogPane.setPrefWidth(700); dialogPane.setPrefWidth(700);
dialogPane.setPrefHeight(400); dialogPane.setPrefHeight(400);
setResizable(true);
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
} }

View file

@ -64,6 +64,7 @@ public class WalletExportDialog extends Dialog<Wallet> {
dialogPane.getButtonTypes().addAll(cancelButtonType); dialogPane.getButtonTypes().addAll(cancelButtonType);
dialogPane.setPrefWidth(500); dialogPane.setPrefWidth(500);
dialogPane.setPrefHeight(480); dialogPane.setPrefHeight(480);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
setResultConverter(dialogButton -> dialogButton != cancelButtonType ? wallet : null); setResultConverter(dialogButton -> dialogButton != cancelButtonType ? wallet : null);

View file

@ -90,6 +90,7 @@ public class WalletImportDialog extends Dialog<Wallet> {
dialogPane.setPrefWidth(500); dialogPane.setPrefWidth(500);
dialogPane.setPrefHeight(600); dialogPane.setPrefHeight(600);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
setResultConverter(dialogButton -> dialogButton != cancelButtonType ? wallet : null); setResultConverter(dialogButton -> dialogButton != cancelButtonType ? wallet : null);

View file

@ -116,6 +116,7 @@ public class WalletSummaryDialog extends Dialog<Void> {
ButtonType okButtonType = new javafx.scene.control.ButtonType("Done", ButtonBar.ButtonData.OK_DONE); ButtonType okButtonType = new javafx.scene.control.ButtonType("Done", ButtonBar.ButtonData.OK_DONE);
dialogPane.getButtonTypes().addAll(okButtonType); dialogPane.getButtonTypes().addAll(okButtonType);
setResizable(true);
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
} }

View file

@ -55,6 +55,7 @@ public class KeystoreImportDialog extends Dialog<Keystore> {
dialogPane.getButtonTypes().add(cancelButtonType); dialogPane.getButtonTypes().add(cancelButtonType);
dialogPane.setPrefWidth(650); dialogPane.setPrefWidth(650);
dialogPane.setPrefHeight(690); dialogPane.setPrefHeight(690);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
setResultConverter(dialogButton -> dialogButton != cancelButtonType ? getWatchOnlyKeystore() : null); setResultConverter(dialogButton -> dialogButton != cancelButtonType ? getWatchOnlyKeystore() : null);

View file

@ -36,6 +36,7 @@ public class PayNymAddressesDialog extends Dialog<Boolean> {
dialogPane.setPrefWidth(800); dialogPane.setPrefWidth(800);
dialogPane.setPrefHeight(600); dialogPane.setPrefHeight(600);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
setResizable(true); setResizable(true);
} catch(IOException e) { } catch(IOException e) {

View file

@ -27,6 +27,7 @@ public class PayNymDialog extends Dialog<PayNym> {
dialogPane.setPrefWidth(730); dialogPane.setPrefWidth(730);
dialogPane.setPrefHeight(600); dialogPane.setPrefHeight(600);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
dialogPane.getStylesheets().add(AppServices.class.getResource("app.css").toExternalForm()); dialogPane.getStylesheets().add(AppServices.class.getResource("app.css").toExternalForm());

View file

@ -48,6 +48,7 @@ public class PreferencesDialog extends Dialog<Boolean> {
dialogPane.setPrefWidth(750); dialogPane.setPrefWidth(750);
dialogPane.setPrefHeight(630); dialogPane.setPrefHeight(630);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
preferencesController.reconnectOnClosingProperty().set(AppServices.isConnecting() || AppServices.isConnected()); preferencesController.reconnectOnClosingProperty().set(AppServices.isConnecting() || AppServices.isConnected());

View file

@ -90,6 +90,7 @@ public class ServerAliasDialog extends Dialog<Server> {
dialogPane.setPrefWidth(680); dialogPane.setPrefWidth(680);
dialogPane.setPrefHeight(500); dialogPane.setPrefHeight(500);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.setStageIcon(dialogPane.getScene().getWindow()); AppServices.setStageIcon(dialogPane.getScene().getWindow());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
} }

View file

@ -22,6 +22,7 @@ public class CounterpartyDialog extends Dialog<Boolean> {
dialogPane.setPrefWidth(730); dialogPane.setPrefWidth(730);
dialogPane.setPrefHeight(520); dialogPane.setPrefHeight(520);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
dialogPane.getStylesheets().add(AppServices.class.getResource("app.css").toExternalForm()); dialogPane.getStylesheets().add(AppServices.class.getResource("app.css").toExternalForm());

View file

@ -45,6 +45,7 @@ public class InitiatorDialog extends Dialog<Transaction> {
dialogPane.setPrefWidth(730); dialogPane.setPrefWidth(730);
dialogPane.setPrefHeight(530); dialogPane.setPrefHeight(530);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
dialogPane.getStylesheets().add(AppServices.class.getResource("general.css").toExternalForm()); dialogPane.getStylesheets().add(AppServices.class.getResource("general.css").toExternalForm());

View file

@ -34,6 +34,7 @@ public class AdvancedDialog extends Dialog<Boolean> {
dialogPane.setPrefWidth(400); dialogPane.setPrefWidth(400);
dialogPane.setPrefHeight(300); dialogPane.setPrefHeight(300);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
setOnCloseRequest(event -> { setOnCloseRequest(event -> {

View file

@ -46,6 +46,7 @@ public class MixToDialog extends Dialog<MixConfig> {
dialogPane.setPrefWidth(400); dialogPane.setPrefWidth(400);
dialogPane.setPrefHeight(300); dialogPane.setPrefHeight(300);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
setResultConverter(dialogButton -> dialogButton == applyButtonType ? mixToController.getMixConfig() : null); setResultConverter(dialogButton -> dialogButton == applyButtonType ? mixToController.getMixConfig() : null);

View file

@ -55,6 +55,7 @@ public class MultisigBackupDialog extends Dialog<String> {
dialogPane.setPrefWidth(700); dialogPane.setPrefWidth(700);
dialogPane.setPrefHeight(500); dialogPane.setPrefHeight(500);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
} }

View file

@ -27,6 +27,7 @@ public class WhirlpoolDialog extends Dialog<Tx0Preview> {
dialogPane.setPrefWidth(600); dialogPane.setPrefWidth(600);
dialogPane.setPrefHeight(570); dialogPane.setPrefHeight(570);
dialogPane.setMinHeight(dialogPane.getPrefHeight());
AppServices.moveToActiveWindowScreen(this); AppServices.moveToActiveWindowScreen(this);
dialogPane.getStylesheets().add(AppServices.class.getResource("app.css").toExternalForm()); dialogPane.getStylesheets().add(AppServices.class.getResource("app.css").toExternalForm());