You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by no...@apache.org on 2011/10/17 10:40:16 UTC
svn commit: r1185041 -
/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
Author: noelgrandin
Date: Mon Oct 17 08:40:16 2011
New Revision: 1185041
URL: http://svn.apache.org/viewvc?rev=1185041&view=rev
Log:
PIVOT-802 Introduce "inactiveBorderColor" to TabPane to allow greater flexibility for look and feel
commit patch from Roger Whitcomb
Modified:
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java?rev=1185041&r1=1185040&r2=1185041&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java Mon Oct 17 08:40:16 2011
@@ -260,7 +260,7 @@ public class TerraTabPaneSkin extends Co
}
// 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 class TerraTabPaneSkin extends Co
if (!(tabButton.isSelected()
|| active)) {
+ graphics.setPaint(borderColor);
// Draw divider
switch(tabOrientation) {
case HORIZONTAL: {
@@ -507,6 +508,7 @@ public class TerraTabPaneSkin extends Co
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 class TerraTabPaneSkin extends Co
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 class TerraTabPaneSkin extends Co
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;
}