Ticket #21349: 21349.patch

File 21349.patch, 2.1 KB (added by marcello@…, 3 years ago)

Patch

  • src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java

     
    1818import java.util.Map;
    1919
    2020import javax.swing.AbstractAction;
    21 import javax.swing.BoxLayout;
    22 import javax.swing.DefaultComboBoxModel;
    2321import javax.swing.JCheckBox;
    2422import javax.swing.JLabel;
    2523import javax.swing.JPanel;
     
    188186
    189187    private void initComponents() {
    190188        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);
    193190
     191        setLayout(new GridBagLayout());
     192        add(buildFilterPanel(), gbc);
     193
    194194        // This is the list of shortcuts:
    195195        TableHelper.setFont(shortcutTable, getClass());
    196196        shortcutTable.setModel(model);
     
    205205        JScrollPane listScrollPane = new JScrollPane();
    206206        listScrollPane.setViewportView(shortcutTable);
    207207
    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));
    211210
    212211        // and here follows the edit area. I won't object to someone re-designing it, it looks, um, "minimalistic" ;)
    213212
     
    222221        cbAlt.setAction(action);
    223222        cbAlt.setText(ALT); // see above for why no tr()
    224223        tfKey.setAction(action);
    225         tfKey.setModel(new DefaultComboBoxModel<>(keyList.values().toArray(new String[keyList.size()])));
     224        tfKey.getModel().addAllElements(keyList.values());
    226225        cbMeta.setAction(action);
    227226        cbMeta.setText(META); // see above for why no tr()
    228227
     
    242241
    243242        action.actionPerformed(null); // init checkboxes
    244243
    245         add(shortcutEditPane);
     244        gbc.weighty = 0;
     245        add(shortcutEditPane, gbc);
    246246    }
    247247
    248248    private JPanel buildFilterPanel() {