Skip to content

Commit 044e51f

Browse files
committed
Set min sizes for dialogs
1 parent ae186ef commit 044e51f

5 files changed

Lines changed: 25 additions & 3 deletions

File tree

tabshell-demo/src/main/java/com/techsenger/tabshell/demo/dialogs/DialogsDialogPresenter.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,21 @@ protected void postInitialize() {
9696
super.postInitialize();
9797
var view = getView();
9898
setResizable(true);
99-
setPrefWidth(600);
100-
setPrefHeight(300);
10199
setTitle("Dialogs");
102100
view.setDialogTypes(Arrays.asList(DialogType.values()));
103101
setResultAction((result) -> {
104102
requestClose();
105103
});
106104
setRightButtons(DialogsDialogButtons.CLOSE);
105+
setMinWidth(400);
106+
setMinHeight(200);
107+
}
108+
109+
@Override
110+
protected void applyAppearance() {
111+
super.applyAppearance();
112+
setPrefWidth(600);
113+
setPrefHeight(300);
107114
}
108115

109116
protected void onDialogClick(DialogType type) {

tabshell-demo/src/main/java/com/techsenger/tabshell/demo/page/PageDialogPresenter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ protected void postInitialize() {
5959
setResultAction((button) -> requestClose());
6060
setRightButtons(PageDialogButtons.OK);
6161
setButtonDefault(PageDialogButtons.OK, true);
62+
setMinWidth(500);
63+
setMinHeight(400);
6264
}
6365

6466
@Override

tabshell-dialogs/src/main/java/com/techsenger/tabshell/dialogs/alert/AlertDialogPresenter.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,16 @@ protected void postInitialize() {
114114
setButtonDefault(AlertDialogButtons.YES, true);
115115
}
116116
setResultAction((result) -> requestClose());
117-
setPrefWidth(600);
118117
setMessage(message);
118+
setMinWidth(400);
119+
setMinHeight(140);
119120
}
121+
122+
@Override
123+
protected void applyAppearance() {
124+
super.applyAppearance();
125+
setPrefWidth(600);
126+
}
127+
128+
120129
}

tabshell-dialogs/src/main/java/com/techsenger/tabshell/dialogs/file/FileChooserDialogPresenter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ protected void postInitialize() {
326326
updateFiles(null);
327327
setRightButtons(FileChooserButtons.CANCEL, FileChooserButtons.OK);
328328
setButtonDefault(FileChooserButtons.OK, true);
329+
setMinWidth(600);
330+
setMinHeight(400);
329331
}
330332

331333
protected URI getDirectory() {

tabshell-dialogs/src/main/java/com/techsenger/tabshell/dialogs/namevalue/NameValueDialogPresenter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,7 @@ public void setValueEditable(boolean valueEditable) {
105105
protected void postInitialize() {
106106
super.postInitialize();
107107
setRightButtons(NameValueButtons.CANCEL, NameValueButtons.OK);
108+
setMinWidth(400);
109+
setMinHeight(250);
108110
}
109111
}

0 commit comments

Comments
 (0)