Permalink
Browse files

PIVOT-802 Introduce "inactiveBorderColor" to TabPane to allow greater…

… flexibility for look and feel

commit patch from Roger Whitcomb

git-svn-id: https://svn.apache.org/repos/asf/pivot/trunk@1185041 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent e8d3384 commit 77dcaff70e6ba97c7ac6b43dd799334686c48fc5 Noel John Grandin committed Oct 17, 2011
Showing with 30 additions and 1 deletion.
  1. +30 −1 wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
@@ -260,7 +260,7 @@ public void paint(Graphics2D graphics) {
}
// Draw the border
- graphics.setPaint(borderColor);
+ graphics.setPaint((tabButton.isSelected() || active) ? borderColor : inactiveBorderColor);
graphics.setStroke(new BasicStroke(1));
switch(tabOrientation) {
@@ -279,6 +279,7 @@ public void paint(Graphics2D graphics) {
if (!(tabButton.isSelected()
|| active)) {
+ graphics.setPaint(borderColor);
// Draw divider
switch(tabOrientation) {
case HORIZONTAL: {
@@ -507,6 +508,7 @@ protected void update() {
private Color activeTabColor;
private Color inactiveTabColor;
private Color borderColor;
+ private Color inactiveBorderColor;
private Insets padding;
private Font buttonFont;
private Color buttonColor;
@@ -546,6 +548,7 @@ public TerraTabPaneSkin() {
activeTabColor = theme.getColor(11);
inactiveTabColor = theme.getColor(9);
borderColor = theme.getColor(7);
+ inactiveBorderColor = theme.getColor(7);
padding = new Insets(6);
buttonFont = theme.getFont();
buttonColor = theme.getColor(1);
@@ -1151,6 +1154,32 @@ public final void setBorderColor(int borderColor) {
setBorderColor(theme.getColor(borderColor));
}
+ public Color getInactiveBorderColor() {
+ return inactiveBorderColor;
+ }
+
+ public void setInactiveBorderColor(Color inactiveBorderColor) {
+ if (inactiveBorderColor == null) {
+ throw new IllegalArgumentException("inactiveBorderColor is null.");
+ }
+
+ this.inactiveBorderColor = inactiveBorderColor;
+ repaintComponent();
+ }
+
+ public final void setInactiveBorderColor(String inactiveBorderColor) {
+ if (inactiveBorderColor == null) {
+ throw new IllegalArgumentException("inactiveBorderColor is null.");
+ }
+
+ setInactiveBorderColor(GraphicsUtilities.decodeColor(inactiveBorderColor));
+ }
+
+ public final void setInactiveBorderColor(int inactiveBorderColor) {
+ TerraTheme theme = (TerraTheme)Theme.getTheme();
+ setInactiveBorderColor(theme.getColor(inactiveBorderColor));
+ }
+
public Insets getPadding() {
return padding;
}

0 comments on commit 77dcaff

Please sign in to comment.