mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Terminals: Bug 443048 - Can't use Middle click to close shell Tabs
inside Terminal View
This commit is contained in:
parent
4e2c2046d2
commit
5f9c9c21a2
1 changed files with 16 additions and 1 deletions
|
@ -39,7 +39,10 @@ import org.eclipse.swt.dnd.DropTargetListener;
|
||||||
import org.eclipse.swt.dnd.Transfer;
|
import org.eclipse.swt.dnd.Transfer;
|
||||||
import org.eclipse.swt.dnd.TransferData;
|
import org.eclipse.swt.dnd.TransferData;
|
||||||
import org.eclipse.swt.events.DisposeListener;
|
import org.eclipse.swt.events.DisposeListener;
|
||||||
|
import org.eclipse.swt.events.MouseAdapter;
|
||||||
|
import org.eclipse.swt.events.MouseEvent;
|
||||||
import org.eclipse.swt.graphics.Color;
|
import org.eclipse.swt.graphics.Color;
|
||||||
|
import org.eclipse.swt.graphics.Point;
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
@ -476,7 +479,7 @@ public class TerminalsView extends ViewPart implements ITerminalsView, IShowInTa
|
||||||
*
|
*
|
||||||
* @param tabFolder The tab folder control. Must not be <code>null</code>.
|
* @param tabFolder The tab folder control. Must not be <code>null</code>.
|
||||||
*/
|
*/
|
||||||
protected void doConfigureTabFolderControl(CTabFolder tabFolder) {
|
protected void doConfigureTabFolderControl(final CTabFolder tabFolder) {
|
||||||
Assert.isNotNull(tabFolder);
|
Assert.isNotNull(tabFolder);
|
||||||
|
|
||||||
// Set the layout data
|
// Set the layout data
|
||||||
|
@ -494,6 +497,18 @@ public class TerminalsView extends ViewPart implements ITerminalsView, IShowInTa
|
||||||
|
|
||||||
// Set the tab style from the global preferences
|
// Set the tab style from the global preferences
|
||||||
tabFolder.setSimple(PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS));
|
tabFolder.setSimple(PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS));
|
||||||
|
|
||||||
|
// Attach the mouse listener
|
||||||
|
tabFolder.addMouseListener(new MouseAdapter() {
|
||||||
|
@Override
|
||||||
|
public void mouseDown(MouseEvent e) {
|
||||||
|
if (e.button == 2) {
|
||||||
|
// middle mouse button click - close tab
|
||||||
|
CTabItem item = tabFolder.getItem(new Point(e.x, e.y));
|
||||||
|
if (item != null) item.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue