|
|
@ -256,23 +256,25 @@ public class DarkTabbedPaneScrollLayout extends TabbedPaneScrollLayout { |
|
|
|
// Calculate how much space the tabs will need, based on the
|
|
|
|
// Calculate how much space the tabs will need, based on the
|
|
|
|
// minimum size required to display largest child + content border
|
|
|
|
// minimum size required to display largest child + content border
|
|
|
|
//
|
|
|
|
//
|
|
|
|
if (!ui.isHorizontalTabPlacement()) { |
|
|
|
if (ui.tabPane.getTabCount() > 0) { |
|
|
|
int tabHeight = ui.calculateTabHeight(tabPlacement, ui.tabPane.getSelectedIndex(), |
|
|
|
if (!ui.isHorizontalTabPlacement()) { |
|
|
|
ui.getFontMetrics().getHeight()); |
|
|
|
int tabHeight = ui.calculateTabHeight(tabPlacement, ui.tabPane.getSelectedIndex(), |
|
|
|
if (ui.scrollableTabSupport.moreTabsButton.isVisible()) { |
|
|
|
ui.getFontMetrics().getHeight()); |
|
|
|
tabHeight += ui.scrollableTabSupport.moreTabsButton.getPreferredSize().height; |
|
|
|
if (ui.scrollableTabSupport.moreTabsButton.isVisible()) { |
|
|
|
} |
|
|
|
tabHeight += ui.scrollableTabSupport.moreTabsButton.getPreferredSize().height; |
|
|
|
height = Math.max(height, tabHeight); |
|
|
|
} |
|
|
|
tabExtent = preferredTabAreaWidth(tabPlacement, height - tabAreaInsets.top - tabAreaInsets.bottom); |
|
|
|
height = Math.max(height, tabHeight); |
|
|
|
width += tabExtent; |
|
|
|
tabExtent = preferredTabAreaWidth(tabPlacement, height - tabAreaInsets.top - tabAreaInsets.bottom); |
|
|
|
} else { |
|
|
|
width += tabExtent; |
|
|
|
int tabWidth = ui.calculateTabWidth(tabPlacement, ui.tabPane.getSelectedIndex(), ui.getFontMetrics()); |
|
|
|
} else { |
|
|
|
if (ui.scrollableTabSupport.moreTabsButton.isVisible()) { |
|
|
|
int tabWidth = ui.calculateTabWidth(tabPlacement, ui.tabPane.getSelectedIndex(), ui.getFontMetrics()); |
|
|
|
tabWidth += ui.scrollableTabSupport.moreTabsButton.getPreferredSize().width; |
|
|
|
if (ui.scrollableTabSupport.moreTabsButton.isVisible()) { |
|
|
|
|
|
|
|
tabWidth += ui.scrollableTabSupport.moreTabsButton.getPreferredSize().width; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
width = Math.max(width, tabWidth); |
|
|
|
|
|
|
|
tabExtent = preferredTabAreaHeight(tabPlacement, width - tabAreaInsets.left - tabAreaInsets.right); |
|
|
|
|
|
|
|
height += tabExtent; |
|
|
|
} |
|
|
|
} |
|
|
|
width = Math.max(width, tabWidth); |
|
|
|
|
|
|
|
tabExtent = preferredTabAreaHeight(tabPlacement, width - tabAreaInsets.left - tabAreaInsets.right); |
|
|
|
|
|
|
|
height += tabExtent; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return new Dimension(width + insets.left + insets.right + contentInsets.left + contentInsets.right, |
|
|
|
return new Dimension(width + insets.left + insets.right + contentInsets.left + contentInsets.right, |
|
|
|
height + insets.bottom + insets.top + contentInsets.top + contentInsets.bottom); |
|
|
|
height + insets.bottom + insets.top + contentInsets.top + contentInsets.bottom); |
|
|
@ -309,7 +311,9 @@ public class DarkTabbedPaneScrollLayout extends TabbedPaneScrollLayout { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
JButton tabsButton = ui.scrollableTabSupport.moreTabsButton; |
|
|
|
JButton tabsButton = ui.scrollableTabSupport.moreTabsButton; |
|
|
|
Rectangle selectedBounds = new Rectangle(ui.rects[ui.tabPane.getSelectedIndex()]); |
|
|
|
Rectangle selectedBounds = ui.tabPane.getSelectedIndex() > 0 |
|
|
|
|
|
|
|
? new Rectangle(ui.rects[ui.tabPane.getSelectedIndex()]) |
|
|
|
|
|
|
|
: new Rectangle(0, 0, 0, 0); |
|
|
|
if (!verticalTabRuns) { |
|
|
|
if (!verticalTabRuns) { |
|
|
|
int rightMargin = size.width - (insets.right + tabAreaInsets.right |
|
|
|
int rightMargin = size.width - (insets.right + tabAreaInsets.right |
|
|
|
+ insets.left + tabAreaInsets.left); |
|
|
|
+ insets.left + tabAreaInsets.left); |
|
|
@ -390,6 +394,7 @@ public class DarkTabbedPaneScrollLayout extends TabbedPaneScrollLayout { |
|
|
|
ui.tabScroller.tabPanel.invalidate(); |
|
|
|
ui.tabScroller.tabPanel.invalidate(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected int preferredTabAreaWidth(final int tabPlacement, final int height) { |
|
|
|
protected int preferredTabAreaWidth(final int tabPlacement, final int height) { |
|
|
|
return ui.calculateMaxTabWidth(tabPlacement); |
|
|
|
return ui.calculateMaxTabWidth(tabPlacement); |
|
|
|