Ticket #20360: JOSM-splash-wrap-fix.diff

File JOSM-splash-wrap-fix.diff, 1.7 KB (added by DevCharly, 7 weeks ago)
  • src/org/openstreetmap/josm/gui/SplashScreen.java

     
    384384
    385385    private static class SplashScreenProgressRenderer extends JPanel {
    386386        private final JosmEditorPane lblTaskTitle = new JosmEditorPane();
     387        private final JScrollPane scrollPane = new JScrollPane(lblTaskTitle,
     388                ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    387389        private final JProgressBar progressBar = new JProgressBar(JProgressBar.HORIZONTAL);
    388390        private static final String LABEL_HTML = "<html>"
    389391                + "<style>ul {margin-top: 0; margin-bottom: 0; padding: 0;} li {margin: 0; padding: 0;}</style>";
     
    393395
    394396            JosmEditorPane.makeJLabelLike(lblTaskTitle, false);
    395397            lblTaskTitle.setText(LABEL_HTML);
    396             final JScrollPane scrollPane = new JScrollPane(lblTaskTitle,
    397                     ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    398398            scrollPane.setPreferredSize(new Dimension(0, 320));
    399399            scrollPane.setBorder(BorderFactory.createEmptyBorder());
    400400            add(scrollPane, GBC.eol().insets(5, 5, 0, 0).fill(GridBagConstraints.HORIZONTAL));
     
    417417        public void setTasks(String tasks) {
    418418            lblTaskTitle.setText(LABEL_HTML + tasks);
    419419            lblTaskTitle.setCaretPosition(lblTaskTitle.getDocument().getLength());
     420            scrollPane.getHorizontalScrollBar().setValue(0);
    420421        }
    421422    }
    422423}