mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-82242 Scroll the tabs with mouse wheel
This commit is contained in:
@@ -51,7 +51,7 @@ public class JBEditorTabs extends JBTabsImpl {
|
||||
|
||||
@Override
|
||||
protected SingleRowLayout createSingleRowLayout() {
|
||||
if (ApplicationManager.getApplication().isInternal()) {
|
||||
if (ApplicationManager.getApplication().isInternal() || Registry.is("editor.use.scrollable.tabs")) {
|
||||
return new ScrollableSingleRowLayout(this);
|
||||
}
|
||||
return super.createSingleRowLayout();
|
||||
|
||||
@@ -48,10 +48,13 @@ public class SingleRowLayout extends TabLayout {
|
||||
|
||||
@Override
|
||||
protected int getIconY(Rectangle iconRec) {
|
||||
return super.getIconY(iconRec) +
|
||||
(myTabs.getTabsPosition() == JBTabsPosition.bottom
|
||||
? TabsUtil.ACTIVE_TAB_UNDERLINE_HEIGHT
|
||||
: -(TabsUtil.ACTIVE_TAB_UNDERLINE_HEIGHT / 2));
|
||||
final int shift;
|
||||
switch (myTabs.getTabsPosition()) {
|
||||
case bottom: shift = TabsUtil.ACTIVE_TAB_UNDERLINE_HEIGHT; break;
|
||||
case top: shift = -(TabsUtil.ACTIVE_TAB_UNDERLINE_HEIGHT / 2); break;
|
||||
default: shift = 0;
|
||||
}
|
||||
return super.getIconY(iconRec) + shift;
|
||||
}
|
||||
};
|
||||
public JPopupMenu myMorePopup;
|
||||
@@ -352,6 +355,9 @@ public class SingleRowLayout extends TabLayout {
|
||||
protected void calculateRequiredLength(SingleRowPassInfo data) {
|
||||
for (TabInfo eachInfo : data.myVisibleInfos) {
|
||||
data.requiredLength += getRequiredLength(eachInfo);
|
||||
if (myTabs.getTabsPosition() == JBTabsPosition.left || myTabs.getTabsPosition() == JBTabsPosition.right) {
|
||||
data.requiredLength -= 1;
|
||||
}
|
||||
data.toLayout.add(eachInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ editor.balloonHints=true
|
||||
editor.mouseSelectionStateResetTimeout=1000
|
||||
editor.mouseSelectionStateResetDeadZone=4
|
||||
editor.use.new.tabs=true
|
||||
editor.use.scrollable.tabs=true
|
||||
editor.smarterSelectionQuoting=true
|
||||
editor.skip.copy.and.cut.for.empty.selection=false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user