Ticket #21349: 21349.patch
File 21349.patch, 2.1 KB (added by , 3 years ago) |
---|
-
src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
18 18 import java.util.Map; 19 19 20 20 import javax.swing.AbstractAction; 21 import javax.swing.BoxLayout;22 import javax.swing.DefaultComboBoxModel;23 21 import javax.swing.JCheckBox; 24 22 import javax.swing.JLabel; 25 23 import javax.swing.JPanel; … … 188 186 189 187 private void initComponents() { 190 188 CbAction action = new CbAction(this); 191 setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); 192 add(buildFilterPanel()); 189 GBC gbc = GBC.eol().insets(3).fill(GBC.HORIZONTAL); 193 190 191 setLayout(new GridBagLayout()); 192 add(buildFilterPanel(), gbc); 193 194 194 // This is the list of shortcuts: 195 195 TableHelper.setFont(shortcutTable, getClass()); 196 196 shortcutTable.setModel(model); … … 205 205 JScrollPane listScrollPane = new JScrollPane(); 206 206 listScrollPane.setViewportView(shortcutTable); 207 207 208 JPanel listPane = new JPanel(new GridLayout()); 209 listPane.add(listScrollPane); 210 add(listPane); 208 gbc.weighty = 1; 209 add(listScrollPane, gbc.fill(GBC.BOTH)); 211 210 212 211 // and here follows the edit area. I won't object to someone re-designing it, it looks, um, "minimalistic" ;) 213 212 … … 222 221 cbAlt.setAction(action); 223 222 cbAlt.setText(ALT); // see above for why no tr() 224 223 tfKey.setAction(action); 225 tfKey. setModel(new DefaultComboBoxModel<>(keyList.values().toArray(new String[keyList.size()])));224 tfKey.getModel().addAllElements(keyList.values()); 226 225 cbMeta.setAction(action); 227 226 cbMeta.setText(META); // see above for why no tr() 228 227 … … 242 241 243 242 action.actionPerformed(null); // init checkboxes 244 243 245 add(shortcutEditPane); 244 gbc.weighty = 0; 245 add(shortcutEditPane, gbc); 246 246 } 247 247 248 248 private JPanel buildFilterPanel() {