diff options
Diffstat (limited to 'javax/swing/plaf/metal/MetalTabbedPaneUI.java')
-rw-r--r-- | javax/swing/plaf/metal/MetalTabbedPaneUI.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/javax/swing/plaf/metal/MetalTabbedPaneUI.java b/javax/swing/plaf/metal/MetalTabbedPaneUI.java index 9e63aa2e3..39dec3d66 100644 --- a/javax/swing/plaf/metal/MetalTabbedPaneUI.java +++ b/javax/swing/plaf/metal/MetalTabbedPaneUI.java @@ -137,7 +137,12 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI /** The graphics to draw the highlight below the tab. */ private Graphics hg; - + + /** + * Indicates if the tabs are having their background filled. + */ + private boolean tabsOpaque; + /** * Constructs a new instance of MetalTabbedPaneUI. */ @@ -327,13 +332,13 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI int firstIndex = tabRuns[currentRun]; // Paint the part of the above tab. - if (tabIndex != firstIndex) + if (tabIndex != firstIndex && tabIndex > 0 && tabsOpaque) { Color c; if (tabPane.getSelectedIndex() == tabIndex - 1) c = selectColor; else - c = UIManager.getColor("TabbedPane.unselectedBackground"); + c = getUnselectedBackground(tabIndex - 1); g.setColor(c); g.fillRect(2, 0, 4, 3); g.drawLine(2, 3, 2, 3); @@ -454,13 +459,13 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI int firstIndex = tabRuns[currentRun]; // Paint part of the above tab. - if (tabIndex != firstIndex) + if (tabIndex != firstIndex && tabIndex > 0 && tabsOpaque) { Color c; if (tabPane.getSelectedIndex() == tabIndex - 1) c = UIManager.getColor("TabbedPane.tabAreaBackground"); else - c = UIManager.getColor("TabbedPane.unselectedBackground"); + c = getUnselectedBackground(tabIndex - 1); g.fillRect(right - 5, 0, 5, 3); g.fillRect(right - 2, 3, 2, 2); } @@ -709,6 +714,7 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI selectColor = UIManager.getColor("TabbedPane.selected"); selectHighlight = UIManager.getColor("TabbedPane.selectHighlight"); tabAreaBackground = UIManager.getColor("TabbedPane.tabAreaBackground"); + tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); minTabWidth = 0; } |