Changeset 17228 in josm


Ignore:
Timestamp:
2020-10-18T12:03:24+02:00 (6 days ago)
Author:
simon04
Message:

see #7548 - Re-organize the preference dialog (left-align tab labels)

Location:
trunk/src/org/openstreetmap/josm/gui/preferences
Files:
2 edited

Legend:

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

    r17097 r17228  
    5555        super(GuiHelper.getFrameForComponent(parent), tr("Preferences"), ModalityType.DOCUMENT_MODAL);
    5656        build();
    57         this.setMinimumSize(new Dimension(600, 350));
     57        this.setMinimumSize(new Dimension(800, 600));
    5858        // set the maximum width to the current screen. If the dialog is opened on a
    5959        // smaller screen than before, this will reset the stored preference.
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r17201 r17228  
    493493        for (PreferenceTab tab : tabs) {
    494494            if (tab.getTabPreferenceSetting().equals(tps)) {
    495                 insertGUITabsForSetting(icon, tps, getTabCount());
     495                insertGUITabsForSetting(icon, tps, tab.getComponent(), getTabCount());
    496496            }
    497497        }
     
    502502        for (PreferenceTab tab : tabs) {
    503503            if (tab.getTabPreferenceSetting().equals(tps)) {
    504                 insertTab(tps.getTitle(), icon, tab.getComponent(), tps.getTooltip(), position++);
     504                insertGUITabsForSetting(icon, tps, tab.getComponent(), position);
     505                position++;
    505506            }
    506507        }
    507508        return position - 1;
     509    }
     510
     511    private void insertGUITabsForSetting(Icon icon, TabPreferenceSetting tps, final Component component, int position) {
     512        String title = "<html><div style='width:150px'>" + tps.getTitle();
     513        insertTab(title, icon, component, tps.getTooltip(), position);
    508514    }
    509515
     
    525531                    } else {
    526532                        // If it has not been initialized, create an empty tab with only icon and tooltip
    527                         addTab(tps.getTitle(), icon, new PreferencePanel(tps), tps.getTooltip());
     533                        insertGUITabsForSetting(icon, tps, new PreferencePanel(tps), getTabCount());
    528534                    }
    529535                }
Note: See TracChangeset for help on using the changeset viewer.