Ticket #22346: 22346.patch
| File 22346.patch, 4.9 KB (added by , 4 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 diff --git a/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java b/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
a b 384 384 layerManager.removeActiveLayerChangeListener(activateLayerAction); 385 385 } 386 386 387 @Override 388 protected int getPanelMaximumHeight() { 389 return this.layerList.getHeight() + this.layerList.getRowHeight(); 390 } 391 392 @Override 393 protected int getPanelMinimumHeight() { 394 return Math.min(4 * this.layerList.getRowHeight(), getPanelMaximumHeight()); 395 } 396 387 397 /** 388 398 * Returns the layer list model. 389 399 * @return the layer list model -
src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 diff --git a/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java b/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
a b 909 909 return new Dimension(dialogsPanel.getWidth(), preferredHeight); 910 910 } 911 911 912 /** 913 * Return the maximum height for the dialog given the current contents 914 * @return The maximum height 915 * @since xxx 916 */ 917 protected int getPanelMaximumHeight() { 918 return Integer.MIN_VALUE; 919 } 920 921 /** 922 * Return the minimum height for the dialog given the current contents 923 * @return The minimum height 924 * @since xxx 925 */ 926 protected int getPanelMinimumHeight() { 927 return Integer.MIN_VALUE; 928 } 929 930 @Override 931 public Dimension getMaximumSize() { 932 if (!this.isCollapsed) { 933 int maxHeight = this.getPanelMaximumHeight(); 934 if (maxHeight >= preferredHeight) { 935 // Use preferred, since maximum is not bounded for all intents and purposes. 936 Dimension buttons = this.buttonsPanel.getPreferredSize(); 937 Dimension title = this.titleBar.getPreferredSize(); 938 return new Dimension(this.dialogsPanel.getWidth(), title.height + maxHeight + buttons.height); 939 } 940 } 941 return super.getMaximumSize(); 942 } 943 944 @Override 945 public Dimension getMinimumSize() { 946 if (!this.isCollapsed) { 947 int minimumHeight = this.getPanelMinimumHeight(); 948 if (minimumHeight > 0) { 949 Dimension buttons = this.buttonsPanel.getMinimumSize(); 950 Dimension title = this.titleBar.getMinimumSize(); 951 return new Dimension(Math.max(buttons.width, title.width), title.height + minimumHeight + buttons.height); 952 } 953 } 954 return super.getMaximumSize(); 955 } 956 912 957 /** 913 958 * Do something when the toggleButton is pressed. 914 959 */ -
src/org/openstreetmap/josm/gui/widgets/ScrollableTable.java
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 diff --git a/src/org/openstreetmap/josm/gui/widgets/ScrollableTable.java b/src/org/openstreetmap/josm/gui/widgets/ScrollableTable.java
a b 2 2 package org.openstreetmap.josm.gui.widgets; 3 3 4 4 import java.awt.Container; 5 import java.awt.Dimension; 5 6 import java.awt.Point; 6 7 import java.awt.Rectangle; 7 8 … … 43 44 viewport.scrollRectToVisible(rect); 44 45 } 45 46 } 47 48 @Override 49 public Dimension getPreferredSize() { 50 if (super.isPreferredSizeSet()) { 51 return super.getPreferredSize(); 52 } 53 Dimension pref = super.getPreferredSize(); 54 return new Dimension(pref.width, this.getRowHeight() * this.getRowCount()); 55 } 56 57 @Override 58 public Dimension getMaximumSize() { 59 if (isMaximumSizeSet()) { 60 return super.getMaximumSize(); 61 } 62 Dimension max = super.getMaximumSize(); 63 return new Dimension(max.width, this.getRowHeight() * (this.getRowCount() + 1)); 64 } 65 66 @Override 67 public Dimension getMinimumSize() { 68 if (this.isMinimumSizeSet()) { 69 return super.getMinimumSize(); 70 } 71 Dimension min = super.getMinimumSize(); 72 return new Dimension(min.width, this.getRowHeight()); 73 } 46 74 }
