mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-80343 Run/Debug tool window: generic UI: dragging tab from tab row into another tab always makes Debug tab current
This commit is contained in:
@@ -21,6 +21,7 @@ import com.intellij.openapi.actionSystem.ActionManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.ui.Gray;
|
||||
import com.intellij.ui.awt.RelativePoint;
|
||||
import com.intellij.ui.tabs.TabInfo;
|
||||
import com.intellij.ui.tabs.TabsUtil;
|
||||
import com.intellij.ui.tabs.UiDecorator;
|
||||
@@ -35,6 +36,7 @@ import javax.swing.*;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Dennis.Ushakov
|
||||
@@ -217,6 +219,19 @@ public class
|
||||
return super.layout(c, bounds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processDropOver(TabInfo over, RelativePoint relativePoint) {
|
||||
super.processDropOver(over, relativePoint);
|
||||
final Point point = relativePoint.getPoint(getComponent());
|
||||
for (Map.Entry<TabInfo, TabLabel> entry : myInfo2Label.entrySet()) {
|
||||
final TabLabel label = entry.getValue();
|
||||
if (label.getBounds().contains(point) && myDropInfo != entry.getKey()) {
|
||||
select(entry.getKey(), false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TabLabel createTabLabel(TabInfo info) {
|
||||
return new MyTabLabel(this, info);
|
||||
|
||||
@@ -163,7 +163,7 @@ public class JBTabsImpl extends JComponent
|
||||
|
||||
private boolean myOwnSwitchProvider = true;
|
||||
private SwitchProvider mySwitchDelegate;
|
||||
private TabInfo myDropInfo;
|
||||
protected TabInfo myDropInfo;
|
||||
private int myDropInfoIndex;
|
||||
|
||||
private TabInfo myOldSelection;
|
||||
|
||||
Reference in New Issue
Block a user