Changeset 15856 in josm for trunk


Ignore:
Timestamp:
2020-02-15T17:09:20+01:00 (5 years ago)
Author:
Don-vip
Message:

fix #18711 - Bold font for tab subtitles in preferences dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r15845 r15856  
    218218        private void buildPanel() {
    219219            setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    220             add(new JLabel(preferenceSetting.getTitle()), GBC.eol().insets(0, 5, 0, 10).anchor(GBC.NORTHWEST));
    221 
    222             JLabel descLabel = new JLabel("<html>"+preferenceSetting.getDescription()+"</html>");
    223             descLabel.setFont(descLabel.getFont().deriveFont(Font.ITALIC));
    224             add(descLabel, GBC.eol().insets(5, 0, 5, 20).fill(GBC.HORIZONTAL));
     220            add(buildHtmlPanel(preferenceSetting.getTitle(), Font.BOLD),
     221                    GBC.eol().insets(0, 5, 0, 10).anchor(GBC.NORTHWEST).fill(GBC.HORIZONTAL));
     222            add(buildHtmlPanel(preferenceSetting.getDescription(), Font.ITALIC),
     223                    GBC.eol().insets(5, 0, 5, 20).fill(GBC.HORIZONTAL));
     224        }
     225
     226        private static JLabel buildHtmlPanel(String text, int fontStyle) {
     227            JLabel label = new JLabel("<html>" + text + "</html>");
     228            label.setFont(label.getFont().deriveFont(fontStyle));
     229            return label;
    225230        }
    226231
Note: See TracChangeset for help on using the changeset viewer.