Changeset 4018 in josm


Ignore:
Timestamp:
2011-04-06T19:09:47+02:00 (9 years ago)
Author:
bastiK
Message:

applied #6187 - Search GUI improvements (patch by bilbo)

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r4012 r4018  
    4343public class SearchAction extends JosmAction implements ParameterizedAction {
    4444
    45     public static final int DEFAULT_SEARCH_HISTORY_SIZE = 10;
     45    public static final int DEFAULT_SEARCH_HISTORY_SIZE = 15;
    4646
    4747    private static final String SEARCH_EXPRESSION = "searchExpression";
     
    136136        // -- prepare the combo box with the search expressions
    137137        //
    138         JLabel label = new JLabel( initialValues instanceof Filter ? tr("Please enter a filter string.") : tr("Please enter a search string."));
     138        JLabel label = new JLabel( initialValues instanceof Filter ? tr("Filter string:") : tr("Search string:"));
    139139        final HistoryComboBox hcbSearchString = new HistoryComboBox();
    140140        hcbSearchString.setText(initialValues.text);
     
    165165        final JCheckBox regexSearch   = new JCheckBox(tr("regular expression"), initialValues.regexSearch);
    166166
     167        JPanel top = new JPanel(new GridBagLayout());
     168        top.add(label, GBC.std().insets(0, 0, 5, 0));
     169        top.add(hcbSearchString, GBC.eol().fill(GBC.HORIZONTAL));
    167170        JPanel left = new JPanel(new GridBagLayout());
    168         left.add(label, GBC.eop());
    169         left.add(hcbSearchString, GBC.eop().fill(GBC.HORIZONTAL));
    170171        left.add(replace, GBC.eol());
    171172        left.add(add, GBC.eol());
     
    212213        right.add(description);
    213214
    214         final JPanel p = new JPanel();
    215         p.add(left);
    216         p.add(right);
     215        final JPanel p = new JPanel(new GridBagLayout());
     216        p.add(top, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 5, 5, 0));
     217        p.add(left, GBC.std().anchor(GBC.NORTH).insets(5, 10, 10, 0));
     218        p.add(right, GBC.eol());
    217219        ExtendedDialog dialog = new ExtendedDialog(
    218220                Main.parent,
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java

    r3891 r4018  
    145145                }
    146146        );
     147        int maxsize=Math.max(getMaximumRowCount(),java.awt.Toolkit.getDefaultToolkit().getScreenSize().height/getPreferredSize().height - 1);
     148        setMaximumRowCount(maxsize);
    147149    }
    148150
  • trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java

    r3215 r4018  
    77
    88import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox;
     9import org.openstreetmap.josm.Main;
    910
    1011public class HistoryComboBox extends AutoCompletingComboBox {
    1112    private ComboBoxHistory model;
    1213
     14    public static final int DEFAULT_SEARCH_HISTORY_SIZE = 15;
     15
    1316    public HistoryComboBox() {
    14         setModel(model = new ComboBoxHistory(15));
     17        int maxsize = Main.pref.getInteger("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE);
     18        setModel(model = new ComboBoxHistory(maxsize));
    1519        setEditable(true);
    1620    }
Note: See TracChangeset for help on using the changeset viewer.