Ticket #4662: ticket_4662.patch

File ticket_4662.patch, 1.2 KB (added by Hojoe, 13 years ago)

the dialog is resized to the width of the JOSM frame (only if it's bigger)

  • src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    ### Eclipse Workspace Patch 1.0
    #P JOSM
     
    77import java.awt.BorderLayout;
    88import java.awt.Component;
    99import java.awt.Dialog.ModalityType;
     10import java.awt.Dimension;
    1011import java.awt.Font;
    1112import java.awt.GridBagLayout;
    1213import java.awt.Point;
     
    265266        };
    266267        final JDialog dlg = optionPane.createDialog(Main.parent, tr("Change values?"));
    267268        dlg.setModalityType(ModalityType.DOCUMENT_MODAL);
    268 
     269        Dimension dlgSize = dlg.getSize();
     270        if(dlgSize.width > Main.parent.getSize().width) {
     271            dlgSize.width = Math.max(250, Main.parent.getSize().width);
     272            dlg.setSize(dlgSize);
     273        }
     274        dlg.setLocationRelativeTo(Main.parent);
    269275        values.getEditor().addActionListener(new ActionListener() {
    270276            public void actionPerformed(ActionEvent e) {
    271277                dlg.setVisible(false);