You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2012/05/03 17:28:26 UTC
svn commit: r1333503 - in /pivot/trunk:
tests/src/org/apache/pivot/tests/WindowTest.java
wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java
Author: smartini
Date: Thu May 3 15:28:25 2012
New Revision: 1333503
URL: http://svn.apache.org/viewvc?rev=1333503&view=rev
Log:
PIVOT-854, handle even not enabled palette. Then test a not enabled window and a not enabled palette in WindowTest
Modified:
pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java
Modified: pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java?rev=1333503&r1=1333502&r2=1333503&view=diff
==============================================================================
--- pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java (original)
+++ pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java Thu May 3 15:28:25 2012
@@ -105,8 +105,10 @@ public class WindowTest implements Appli
Frame window1bi = new Frame();
window1bi.setTitle("Window 1 B I");
- window1bi.setPreferredSize(160, 60);
+ window1bi.setPreferredSize(180, 60);
window1bi.setLocation(270, 160);
+ window1bi.setContent(new Label("This window is not enabled"));
+ window1bi.setEnabled(false); // to test even a not enabled window ...
window1bi.open(window1b);
Frame window1bii = new Frame();
@@ -118,13 +120,15 @@ public class WindowTest implements Appli
Palette palette1 = new Palette();
palette1.setTitle("Palette 1bii 1");
palette1.setPreferredSize(160, 60);
- palette1.setLocation(300, 200);
+ palette1.setLocation(290, 210);
palette1.open(window1bii);
Palette palette2 = new Palette();
palette2.setTitle("Palette 1bii 2");
palette2.setPreferredSize(160, 60);
- palette2.setLocation(550, 200);
+ palette2.setLocation(600, 200);
+ palette2.setContent(new Label("This palette is not enabled"));
+ palette2.setEnabled(false); // to test even a not enabled palette ...
palette2.open(window1bii);
dialogOwner.setTitle("Dialog Owner");
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java?rev=1333503&r1=1333502&r2=1333503&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java Thu May 3 15:28:25 2012
@@ -154,7 +154,6 @@ public class TerraPaletteSkin extends Wi
private Color titleBarBackgroundColor;
private Color titleBarBorderColor;
private Color contentBorderColor;
- // private Color inactiveTitleBarColor;
private Color inactiveTitleBarBackgroundColor;
private Color inactiveTitleBarBorderColor;
@@ -171,7 +170,6 @@ public class TerraPaletteSkin extends Wi
contentBorderColor = theme.getColor(7);
// Set the derived colors
- // inactiveTitleBarColor = theme.getColor(7);
inactiveTitleBarBackgroundColor = theme.getColor(9);
inactiveTitleBarBorderColor = theme.getColor(7);
@@ -365,8 +363,10 @@ public class TerraPaletteSkin extends Wi
Palette palette = (Palette)getComponent();
boolean active = palette.getOwner().isActive();
- Color currentTitleBarBackgroundColor = active ? titleBarBackgroundColor : inactiveTitleBarBackgroundColor;
- Color currentTitleBarBorderColor = active ? titleBarBorderColor : inactiveTitleBarBorderColor;
+ boolean enabled = palette.isEnabled();
+
+ Color currentTitleBarBackgroundColor = (active && enabled) ? titleBarBackgroundColor : inactiveTitleBarBackgroundColor;
+ Color currentTitleBarBorderColor = (active && enabled) ? titleBarBorderColor : inactiveTitleBarBorderColor;
Color titleBarBevelColor = TerraTheme.brighten(currentTitleBarBackgroundColor);
// Draw the title area