Changeset 4872 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2012-01-26T09:55:54+01:00 (8 years ago)
Author:
akks
Message:

Fix #7320 - make dialog for edit gpx track properties resizeable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r4745 r4872  
    1717import java.awt.RenderingHints;
    1818import java.awt.Stroke;
     19import java.awt.Toolkit;
    1920import java.awt.event.ActionEvent;
    2021import java.awt.event.MouseAdapter;
     
    4041import javax.swing.AbstractAction;
    4142import javax.swing.Action;
     43import javax.swing.BorderFactory;
    4244import javax.swing.DefaultComboBoxModel;
    4345import javax.swing.Icon;
     
    18301832            }
    18311833            GPXSettingsPanel panel=new GPXSettingsPanel(getName(), hasLocal, hasNonlocal);
    1832 
    1833             int answer = JOptionPane.showConfirmDialog(Main.parent, panel,
     1834            JScrollPane scrollpane = new JScrollPane(panel,
     1835                    JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
     1836            scrollpane.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0 ));
     1837            int screenHeight = Toolkit.getDefaultToolkit().getScreenSize().height;
     1838            if (screenHeight < 700) { // to fit on screen 800x600
     1839                scrollpane.setPreferredSize(new Dimension(panel.getPreferredSize().width, Math.min(panel.getPreferredSize().height,450)));
     1840            }
     1841            int answer = JOptionPane.showConfirmDialog(Main.parent, scrollpane,
    18341842                    tr("Customize track drawing"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
    18351843            if (answer == JOptionPane.CANCEL_OPTION || answer == JOptionPane.CLOSED_OPTION) return;
Note: See TracChangeset for help on using the changeset viewer.