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


Ignore:
Timestamp:
2021-03-20T14:00:10+01:00 (4 years ago)
Author:
simon04
Message:

fix #20244 - OAuthAuthorizationWizard: Remove large OAuth logo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/oauth/OAuthAuthorizationWizard.java

    r14153 r17598  
    99import java.awt.FlowLayout;
    1010import java.awt.Font;
    11 import java.awt.GridBagConstraints;
    1211import java.awt.GridBagLayout;
    13 import java.awt.Insets;
    1412import java.awt.event.ActionEvent;
    1513import java.awt.event.ComponentAdapter;
     
    4846import org.openstreetmap.josm.spi.preferences.Config;
    4947import org.openstreetmap.josm.tools.CheckParameterUtil;
     48import org.openstreetmap.josm.tools.GBC;
    5049import org.openstreetmap.josm.tools.ImageProvider;
    5150import org.openstreetmap.josm.tools.InputMapUtils;
     
    112111        JPanel pnl = new JPanel(new GridBagLayout());
    113112        pnl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    114         GridBagConstraints gc = new GridBagConstraints();
    115 
    116         // the oauth logo in the header
    117         gc.anchor = GridBagConstraints.NORTHWEST;
    118         gc.fill = GridBagConstraints.HORIZONTAL;
    119         gc.weightx = 1.0;
    120         gc.gridwidth = 2;
    121         ImageProvider logoProv = new ImageProvider("oauth", "oauth-logo").setMaxHeight(100);
    122         JLabel lbl = new JLabel(logoProv.get());
    123         lbl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    124         lbl.setOpaque(true);
    125         pnl.add(lbl, gc);
    126113
    127114        // OAuth in a nutshell ...
    128         gc.gridy = 1;
    129         gc.insets = new Insets(5, 0, 0, 5);
    130115        HtmlPanel pnlMessage = new HtmlPanel();
    131116        pnlMessage.setText("<html><body>"
     
    135120        );
    136121        pnlMessage.enableClickableHyperlinks();
    137         pnl.add(pnlMessage, gc);
     122        pnl.add(pnlMessage, GBC.eol().fill(GBC.HORIZONTAL));
    138123
    139124        // the authorisation procedure
    140         gc.gridy = 2;
    141         gc.gridwidth = 1;
    142         gc.weightx = 0.0;
    143         lbl = new JLabel(tr("Please select an authorization procedure: "));
     125        JLabel lbl = new JLabel(tr("Please select an authorization procedure: "));
    144126        lbl.setFont(lbl.getFont().deriveFont(Font.PLAIN));
    145         pnl.add(lbl, gc);
    146 
    147         gc.gridx = 1;
    148         gc.gridwidth = 1;
    149         gc.weightx = 1.0;
    150         pnl.add(cbAuthorisationProcedure, gc);
     127        pnl.add(lbl, GBC.std());
     128
     129        pnl.add(cbAuthorisationProcedure, GBC.eol().fill(GBC.HORIZONTAL));
    151130        cbAuthorisationProcedure.addItemListener(new AuthorisationProcedureChangeListener());
    152131        lbl.setLabelFor(cbAuthorisationProcedure);
    153132
    154133        if (!Config.getUrls().getDefaultOsmApiUrl().equals(apiUrl)) {
    155             gc.gridy = 3;
    156             gc.gridwidth = 2;
    157             gc.gridx = 0;
    158134            final HtmlPanel pnlWarning = new HtmlPanel();
    159135            final HTMLEditorKit kit = (HTMLEditorKit) pnlWarning.getEditorPane().getEditorKit();
     
    168144                    + "</p>"
    169145                    + "</body></html>");
    170             pnl.add(pnlWarning, gc);
     146            pnl.add(pnlWarning, GBC.eop().fill());
    171147        }
    172148
     
    206182
    207183        setTitle(tr("Get an Access Token for ''{0}''", apiUrl));
    208         this.setMinimumSize(new Dimension(500, 400));
     184        this.setMinimumSize(new Dimension(500, 300));
    209185
    210186        pnlFullyAutomaticAuthorisationUI = new FullyAutomaticAuthorizationUI(apiUrl, executor);
Note: See TracChangeset for help on using the changeset viewer.