Changeset 12046 in josm for trunk


Ignore:
Timestamp:
2017-05-03T14:07:20+02:00 (8 years ago)
Author:
michael2402
Message:

In conflict resolution dialog, only scroll tab contents and prevent vertical scroll bar from appearing on small screens just because the horizontal scroll bar makes the dialog content smaller.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ConflictResolver.java

    r11330 r12046  
    1212
    1313import javax.swing.ImageIcon;
     14import javax.swing.JComponent;
    1415import javax.swing.JPanel;
     16import javax.swing.JScrollPane;
    1517import javax.swing.JTabbedPane;
    1618
     
    98100        propertiesMerger.setName("panel.propertiesmerger");
    99101        propertiesMerger.getModel().addPropertyChangeListener(this);
    100         tabbedPane.add(tr("Properties"), propertiesMerger);
     102        addTab(tr("Properties"), propertiesMerger);
    101103
    102104        tagMerger = new TagMerger();
    103105        tagMerger.setName("panel.tagmerger");
    104106        tagMerger.getModel().addPropertyChangeListener(this);
    105         tabbedPane.add(tr("Tags"), tagMerger);
     107        addTab(tr("Tags"), tagMerger);
    106108
    107109        nodeListMerger = new NodeListMerger();
    108110        nodeListMerger.setName("panel.nodelistmerger");
    109111        nodeListMerger.getModel().addPropertyChangeListener(this);
    110         tabbedPane.add(tr("Nodes"), nodeListMerger);
     112        addTab(tr("Nodes"), nodeListMerger);
    111113
    112114        relationMemberMerger = new RelationMemberMerger();
    113115        relationMemberMerger.setName("panel.relationmembermerger");
    114116        relationMemberMerger.getModel().addPropertyChangeListener(this);
    115         tabbedPane.add(tr("Members"), relationMemberMerger);
     117        addTab(tr("Members"), relationMemberMerger);
    116118
    117119        setLayout(new BorderLayout());
     
    122124        conflictResolvers.add(nodeListMerger);
    123125        conflictResolvers.add(relationMemberMerger);
     126    }
     127
     128    private void addTab(String title, JComponent tabContent) {
     129        JScrollPane scrollPanel = new JScrollPane(tabContent);
     130        tabbedPane.add(title, scrollPanel);
    124131    }
    125132
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java

    r10958 r12046  
    102102        HelpUtil.setHelpContext(this.getRootPane(), ht("Dialog/Conflict"));
    103103
    104         setContent(p);
     104        setContent(p, false);
    105105    }
    106106
Note: See TracChangeset for help on using the changeset viewer.