mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't draw clipped tabs on the bottom when vertical layout is used
This commit is contained in:
+2
-1
@@ -104,7 +104,8 @@ public class ScrollableSingleRowLayout extends SingleRowLayout {
|
||||
length = getStrategy().getLengthIncrement(label.getPreferredSize());
|
||||
final int moreRectSize = getStrategy().getMoreRectAxisSize();
|
||||
if (data.position + length > data.toFitLength - moreRectSize) {
|
||||
super.applyTabLayout(data, label, data.toFitLength - data.position - moreRectSize - 4, deltaToFit);
|
||||
final int clippedLength = getStrategy().drawPartialOverflowTabs() ? data.toFitLength - data.position - moreRectSize - 4 : 0;
|
||||
super.applyTabLayout(data, label, clippedLength, deltaToFit);
|
||||
label.setAlignmentToCenter(false);
|
||||
label.setActionPanelVisible(false);
|
||||
return false;
|
||||
|
||||
+15
@@ -73,6 +73,13 @@ public abstract class SingleRowLayoutStrategy {
|
||||
|
||||
public abstract boolean isDragOut(TabLabel tabLabel, int deltaX, int deltaY);
|
||||
|
||||
/**
|
||||
* Whether a tab that didn't fit completely on the right/bottom side in scrollable layout should be clipped or hidden altogether.
|
||||
*
|
||||
* @return true if the tab should be clipped, false if hidden.
|
||||
*/
|
||||
public abstract boolean drawPartialOverflowTabs();
|
||||
|
||||
abstract static class Horizontal extends SingleRowLayoutStrategy {
|
||||
protected Horizontal(final SingleRowLayout layout) {
|
||||
super(layout);
|
||||
@@ -129,6 +136,10 @@ public abstract class SingleRowLayoutStrategy {
|
||||
return data.insets.left;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean drawPartialOverflowTabs() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
static class Top extends Horizontal {
|
||||
@@ -287,6 +298,10 @@ public abstract class SingleRowLayoutStrategy {
|
||||
return myTabs.myHeaderFitSize.width;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean drawPartialOverflowTabs() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static class Left extends Vertical {
|
||||
|
||||
Reference in New Issue
Block a user