Skip to content

Commit 98af24e

Browse files
authored
Merge pull request #188 from Rezoran/main
fix: wayland dialog rendering issues by adding pack()
2 parents 98d1693 + 37ea274 commit 98af24e

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

configurator/src/main/java/com/airepublic/bmstoinverter/configurator/BMSDialog.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public BMSDialog(final Configurator configurator) {
5959
descriptors = createBMSDescriptors();
6060

6161
setLocation(configurator.getBounds().width / 2 - 175, configurator.getBounds().height / 2 - 60);
62-
setSize(new Dimension(350, 359));
62+
setPreferredSize(new Dimension(350, 359));
6363
setResizable(false);
6464
getContentPane().setLayout(new BorderLayout(0, 0));
6565

@@ -220,6 +220,7 @@ public BMSDialog(final Configurator configurator) {
220220
gbc_cancelButton.gridy = 0;
221221
buttonPanel.add(cancelButton, gbc_cancelButton);
222222

223+
pack();
223224
setLocationRelativeTo(null);
224225
}
225226

configurator/src/main/java/com/airepublic/bmstoinverter/configurator/InstallationDialog.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class InstallationDialog extends JDialog {
4646
public InstallationDialog(final JFrame frame) {
4747
super(frame, "Installing...", true);
4848
setLocation(frame.getX() + frame.getBounds().width / 2 - 320, frame.getY() + frame.getBounds().height / 2 - 240);
49-
setSize(new Dimension(640, 480));
49+
setPreferredSize(new Dimension(640, 480));
5050
getContentPane().setLayout(new BorderLayout(0, 0));
5151

5252
final JPanel panel = new JPanel();
@@ -83,6 +83,9 @@ public InstallationDialog(final JFrame frame) {
8383
gbc_closeButton.gridy = 1;
8484
panel.add(closeButton, gbc_closeButton);
8585
closeButton.addActionListener(e -> dispose());
86+
87+
pack();
88+
setLocationRelativeTo(null);
8689
}
8790

8891

configurator/src/main/java/com/airepublic/bmstoinverter/configurator/PluginDialog.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public PluginDialog(final Configurator configurator, final Class<? extends Abstr
5454
super(configurator, "Plugin configuration...", true);
5555

5656
setLocation(configurator.getBounds().width / 2 - 250, configurator.getBounds().height / 2 - 60);
57-
setSize(new Dimension(500, 450));
57+
setPreferredSize(new Dimension(500, 450));
5858
setResizable(false);
5959
getContentPane().setLayout(new BorderLayout(5, 5));
6060

@@ -120,6 +120,7 @@ public PluginDialog(final Configurator configurator, final Class<? extends Abstr
120120
propertiesScrollPane.validate();
121121
});
122122

123+
pack();
123124
setLocationRelativeTo(null);
124125
}
125126

0 commit comments

Comments
 (0)