toolwindow dragging problems fix (cherry picked from commit 6b3ffea)

This commit is contained in:
Konstantin Bulenkov
2012-03-21 16:16:28 +01:00
parent ea0ec4dc8a
commit 1a0cae257f
2 changed files with 6 additions and 6 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -188,9 +188,9 @@ public abstract class ToolWindowHeader extends JPanel implements Disposable {
});
addMouseListener(new MouseAdapter() {
public void mouseReleased(final MouseEvent e) {
public void mousePressed(final MouseEvent e) {
if (!e.isPopupTrigger()) {
if (UIUtil.isCloseClick(e, MouseEvent.MOUSE_RELEASED)) {
if (UIUtil.isCloseClick(e)) {
if (e.isAltDown()) {
toolWindow.fireHidden();
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -303,11 +303,11 @@ public class ToolWindowContentUi extends JPanel implements ContentUI, PropertyCh
});
c.addMouseListener(new MouseAdapter() {
public void mouseReleased(final MouseEvent e) {
public void mousePressed(final MouseEvent e) {
myLastPoint[0] = e.getPoint();
SwingUtilities.convertPointToScreen(myLastPoint[0], c);
if (!e.isPopupTrigger()) {
if (UIUtil.isCloseClick(e, MouseEvent.MOUSE_RELEASED)) {
if (UIUtil.isCloseClick(e)) {
ui.processHide(e);
}
else {