altosui: Try to get dialogs to look a little better
authorKeith Packard <keithp@keithp.com>
Wed, 24 Aug 2011 07:29:36 +0000 (00:29 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 24 Aug 2011 07:29:36 +0000 (00:29 -0700)
grid bag constraints are not my friend.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/AltosFlightUI.java
altosui/AltosIgniteUI.java
altosui/AltosScanUI.java

index 5176804..abe08a1 100644 (file)
@@ -172,7 +172,10 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
                        });
                        c.gridx = 0;
                        c.gridy = 0;
+                       c.weightx = 0;
+                       c.weighty = 0;
                        c.insets = new Insets(3, 3, 3, 3);
+                       c.fill = GridBagConstraints.NONE;
                        c.anchor = GridBagConstraints.WEST;
                        bag.add (frequencies, c);
 
@@ -186,6 +189,8 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
                                telemetry = Altos.ao_telemetry_standard;
                        telemetries.setSelectedIndex(telemetry - 1);
                        telemetries.setMaximumRowCount(Altos.ao_telemetry_max);
+                       telemetries.setPreferredSize(null);
+                       telemetries.revalidate();
                        telemetries.addActionListener(new ActionListener() {
                                        public void actionPerformed(ActionEvent e) {
                                                int telemetry = telemetries.getSelectedIndex() + 1;
@@ -195,6 +200,8 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
                                });
                        c.gridx = 1;
                        c.gridy = 0;
+                       c.weightx = 0;
+                       c.weighty = 0;
                        c.fill = GridBagConstraints.NONE;
                        c.anchor = GridBagConstraints.WEST;
                        bag.add (telemetries, c);
index 806b87b..c11a861 100644 (file)
@@ -341,8 +341,8 @@ public class AltosIgniteUI
                c.fill = GridBagConstraints.NONE;
                c.anchor = GridBagConstraints.CENTER;
                c.insets = i;
-               c.weightx = 1;
-               c.weighty = 1;
+               c.weightx = 0;
+               c.weighty = 0;
 
                c.gridx = 0;
                c.gridy = 0;
@@ -412,7 +412,6 @@ public class AltosIgniteUI
                close.addActionListener(this);
                close.setActionCommand("close");
                        
-
                pack();
                setLocationRelativeTo(owner);
 
index dd6672a..bce4b32 100644 (file)
@@ -386,7 +386,7 @@ public class AltosScanUI
                
                set_label();
 
-               c.fill = GridBagConstraints.NONE;
+               c.fill = GridBagConstraints.HORIZONTAL;
                c.anchor = GridBagConstraints.WEST;
                c.insets = i;
                c.weightx = 1;