Changeset 17353 in josm for trunk


Ignore:
Timestamp:
2020-11-24T15:20:53+01:00 (5 months ago)
Author:
GerdP
Message:

fix #12536: Conflict window completely hides relation 'conflicts' while doing a "Replace Geometry"

  • improve calculation of divider location

When resizing the dialog the refreshed result is still poor but I hope that's less annoying.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java

    r14251 r17353  
    344344
    345345        getContentPane().add(pnlButtons, BorderLayout.SOUTH);
    346         validate();
     346        getContentPane().validate();
    347347        adjustDividerLocation();
    348348        pnlRelationMemberConflictResolver.prepareForEditing();
     
    445445        int numTagDecisions = modelTagConflictResolver.getNumDecisions();
    446446        int numRelationDecisions = modelRelConflictResolver.getNumDecisions();
    447         if (numTagDecisions > 0 && numRelationDecisions > 0) {
    448             double nTop = 1.0 + numTagDecisions;
    449             double nBottom = 2.5 + numRelationDecisions;
    450             spTagConflictTypes.setDividerLocation(nTop/(nTop+nBottom));
     447
     448
     449        if (numTagDecisions > 0 && numRelationDecisions > 0 && getHeight() > 0) {
     450            // see #12536: Take the space for buttons and checkbox into account.
     451            double hPopup = getHeight();
     452            double h1 = (pnlRelationMemberConflictResolver.getHeight() + pnlTagConflictResolver.getHeight());
     453            double correction = h1 > 0 ? ((hPopup-h1)/hPopup) : 0;
     454
     455            double nTop = 3.5 + numTagDecisions;
     456            double nBottom = 5.5 + numRelationDecisions;
     457            spTagConflictTypes.setDividerLocation(nTop/(nTop+nBottom) - correction);
    451458        }
    452459    }
Note: See TracChangeset for help on using the changeset viewer.