You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by rw...@apache.org on 2017/12/07 23:55:48 UTC

svn commit: r1817443 - in /pivot/trunk: wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTextAreaSkin.java wtk-terra/src/org/apache/pivot/wtk/skin/terra/terra_theme_defaults.json wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java

Author: rwhitcomb
Date: Thu Dec  7 23:55:48 2017
New Revision: 1817443

URL: http://svn.apache.org/viewvc?rev=1817443&view=rev
Log:
PIVOT-1014:  Update TextAreaSkin and TerraTextAreaSkin to use the
default styles in the "terra_theme_defaults.json" file.
There were some inconsistencies between these two that aren't fully
resolved yet, but the behavior now should be the same as it was before.

Modified:
    pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTextAreaSkin.java
    pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/terra_theme_defaults.json
    pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java

Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTextAreaSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTextAreaSkin.java?rev=1817443&r1=1817442&r2=1817443&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTextAreaSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTextAreaSkin.java Thu Dec  7 23:55:48 2017
@@ -25,13 +25,7 @@ import org.apache.pivot.wtk.skin.TextAre
  */
 public class TerraTextAreaSkin extends TextAreaSkin {
     public TerraTextAreaSkin() {
-        setColor(1);
-        setBackgroundColor(11);
-        setInactiveColor(7);
-        setSelectionColor(4);
-        setSelectionBackgroundColor(14);
-        setInactiveSelectionColor(1);
-        setInactiveSelectionBackgroundColor(9);
+        // Defaults set in the "terra_theme_defaults.json" file
     }
 
     public final void setColor(int color) {

Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/terra_theme_defaults.json
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/terra_theme_defaults.json?rev=1817443&r1=1817442&r2=1817443&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/terra_theme_defaults.json (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/terra_theme_defaults.json Thu Dec  7 23:55:48 2017
@@ -37,6 +37,35 @@
         buffer : 4,
         fill : false,
         headingToggles : true
+    },
+
+    TerraTextAreaSkin : {
+        // TODO: conflicts here b/w TextAreaSkin and TerraTextAreaSkin:
+        // This is what TextAreaSkin says right now:
+        // color = defaultForegroundColor();
+        // selectionBackgroundColor = defaultForegroundColor();
+        // inactiveSelectionBackgroundColor = defaultForegroundColor();
+        // if (!themeIsDark()) {
+        //    selectionColor = Color.LIGHT_GRAY;
+        //    inactiveSelectionColor = Color.LIGHT_GRAY;
+        // } else {
+        //    selectionColor = Color.DARK_GRAY;
+        //    inactiveSelectionColor = Color.DARK_GRAY;
+        // }
+        // These were taken from TextAreaSkin (after the preceding code):
+        backgroundColor : 'null',
+        inactiveColor : 'GRAY',
+        margin : 4,
+        wrapText : true,
+        tabWidth : 4,
+        // But, the colors below were taken from TerraTextAreaSkin...
+        color : 1,
+        backgroundColor : 11,
+        inactiveColor : 7,
+        selectionColor : 4,
+        selectionBackgroundColor : 14,
+        inactiveSelectionColor : 1,
+        inactiveSelectionBackgroundColor : 9
     }
 
     /* More to come ... */

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java?rev=1817443&r1=1817442&r2=1817443&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java Thu Dec  7 23:55:48 2017
@@ -154,6 +154,8 @@ public class TextAreaSkin extends Compon
         Theme theme = currentTheme();
         font = theme.getFont();
 
+        // TODO: find a way to set this in the theme defaults.json file
+        // TODO: these conflict with the values set in TerraTextAreaSkin...
         color = defaultForegroundColor();
         selectionBackgroundColor = defaultForegroundColor();
         inactiveSelectionBackgroundColor = defaultForegroundColor();
@@ -165,17 +167,16 @@ public class TextAreaSkin extends Compon
             inactiveSelectionColor = Color.DARK_GRAY;
         }
 
-        backgroundColor = null;
-        inactiveColor = Color.GRAY;
-        margin = new Insets(4);
-        wrapText = true;
-        tabWidth = 4;
+        // Remaining default styles set in the theme defaults.json file
     }
 
     @Override
     public void install(Component component) {
         super.install(component);
 
+        Theme theme = currentTheme();
+        theme.setDefaultStyles(this);
+
         TextArea textArea = (TextArea) component;
         textArea.getTextAreaListeners().add(this);
         textArea.getTextAreaContentListeners().add(this);