resize problems

This commit is contained in:
Konstantin Bulenkov
2012-02-28 17:49:09 +01:00
parent a8ba60bfe0
commit 433aeadc0d
@@ -142,6 +142,7 @@ public abstract class DialogWrapper {
};
private List<JBOptionButton> myOptionsButtons = new ArrayList<JBOptionButton>();
private int myCurrentOptionsButtonIndex = -1;
private boolean myResizeInProgress = false;
protected String getDoNotShowMessage() {
return CommonBundle.message("dialog.options.do.not.show");
@@ -167,6 +168,14 @@ public abstract class DialogWrapper {
*/
protected DialogWrapper(Project project, boolean canBeParent) {
myPeer = createPeer(project, canBeParent);
myPeer.getWindow().addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
if (!myResizeInProgress) {
myActualSize = myPeer.getSize();
}
}
});
createDefaultActions();
}
@@ -1611,8 +1620,10 @@ public abstract class DialogWrapper {
private void resizeWithAnimation(final Dimension size) {
//todo[kb]: fix this PITA
myResizeInProgress = true;
if (!Registry.is("enable.animation.on.dialogs")) {
setSize(size.width, size.height);
myResizeInProgress = false;
return;
}
@@ -1637,6 +1648,7 @@ public abstract class DialogWrapper {
if (myErrorText.shouldBeVisible()) {
myErrorText.setVisible(true);
}
myResizeInProgress = false;
}
}.start();
}