[gnome-games] [same-gnome-clutter] Live theme changing; add test theme



commit 29b75dc2e0aeca63cf4f951081e3b74037944adb
Author: Tim Horton <hortont424 gmail com>
Date:   Sun Jul 12 21:20:21 2009 -0400

    [same-gnome-clutter] Live theme changing; add test theme

 same-gnome-clutter/data/themes/Makefile.am      |    2 +-
 same-gnome-clutter/data/themes/test/Makefile.am |   17 ++++
 same-gnome-clutter/data/themes/test/bkg.svg     |   95 ++++++++++++++++++++++
 same-gnome-clutter/data/themes/test/blue.svg    |   97 +++++++++++++++++++++++
 same-gnome-clutter/data/themes/test/green.svg   |   97 +++++++++++++++++++++++
 same-gnome-clutter/data/themes/test/red.svg     |   97 +++++++++++++++++++++++
 same-gnome-clutter/data/themes/test/theme.js    |   12 +++
 same-gnome-clutter/data/themes/test/yellow.svg  |   97 +++++++++++++++++++++++
 same-gnome-clutter/src/Board.js                 |    7 ++
 same-gnome-clutter/src/Light.js                 |    7 ++
 same-gnome-clutter/src/Settings.js              |   16 +++-
 same-gnome-clutter/src/main.js                  |    3 +-
 12 files changed, 542 insertions(+), 5 deletions(-)
---
diff --git a/same-gnome-clutter/data/themes/Makefile.am b/same-gnome-clutter/data/themes/Makefile.am
index 4ac00c0..efe80d4 100644
--- a/same-gnome-clutter/data/themes/Makefile.am
+++ b/same-gnome-clutter/data/themes/Makefile.am
@@ -1 +1 @@
-SUBDIRS = tango
+SUBDIRS = tango test
diff --git a/same-gnome-clutter/data/themes/test/Makefile.am b/same-gnome-clutter/data/themes/test/Makefile.am
new file mode 100644
index 0000000..b035a88
--- /dev/null
+++ b/same-gnome-clutter/data/themes/test/Makefile.am
@@ -0,0 +1,17 @@
+themedir = $(pkgdatadir)/same-gnome-clutter/themes/test
+theme_DATA = \
+	bkg.svg \
+	blue.svg \
+	green.svg \
+	red.svg \
+	yellow.svg \
+	theme.js
+
+EXTRA_DIST = \
+	bkg.svg \
+	blue.svg \
+	green.svg \
+	red.svg \
+	yellow.svg \
+	theme.js
+
diff --git a/same-gnome-clutter/data/themes/test/bkg.svg b/same-gnome-clutter/data/themes/test/bkg.svg
new file mode 100644
index 0000000..6741c6f
--- /dev/null
+++ b/same-gnome-clutter/data/themes/test/bkg.svg
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="639.42859"
+   height="479.57144"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docname="bkg.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient3155">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop3157" />
+      <stop
+         style="stop-color:#5c5c5c;stop-opacity:1;"
+         offset="1"
+         id="stop3159" />
+    </linearGradient>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3155"
+       id="linearGradient3161"
+       x1="652.57147"
+       y1="248.36218"
+       x2="652.57147"
+       y2="727.93359"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(28.571424,17.142857)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="-127.85714"
+     inkscape:cy="520"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1440"
+     inkscape:window-height="842"
+     inkscape:window-x="0"
+     inkscape:window-y="0" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-41.714302,-265.50504)">
+    <rect
+       style="opacity:1;fill:url(#linearGradient3161);fill-opacity:1;stroke:none;stroke-width:319.71429443;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect2383"
+       width="639.42859"
+       height="479.57144"
+       x="41.714302"
+       y="265.50504" />
+  </g>
+</svg>
diff --git a/same-gnome-clutter/data/themes/test/blue.svg b/same-gnome-clutter/data/themes/test/blue.svg
new file mode 100644
index 0000000..871267e
--- /dev/null
+++ b/same-gnome-clutter/data/themes/test/blue.svg
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="50"
+   height="50"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="blue.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.0">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient3179">
+      <stop
+         style="stop-color:#aa669b;stop-opacity:0.96078432;"
+         offset="0"
+         id="stop3181" />
+      <stop
+         style="stop-color:#aa92c8;stop-opacity:0.96078432;"
+         offset="1"
+         id="stop3183" />
+    </linearGradient>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3179"
+       id="linearGradient3193"
+       x1="164.71428"
+       y1="344.79077"
+       x2="315.28571"
+       y2="344.79077"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.3187856,0,0,0.3187856,113.20576,133.30501)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="4.0711576"
+     inkscape:cx="44.4591"
+     inkscape:cy="80.411519"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1440"
+     inkscape:window-height="842"
+     inkscape:window-x="0"
+     inkscape:window-y="0" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-164.71428,-194.21933)">
+    <rect
+       style="opacity:1;fill:url(#linearGradient3193);fill-opacity:1;stroke:#729fcf;stroke-width:0.63757122;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3157"
+       width="47.362427"
+       height="47.362431"
+       x="166.03307"
+       y="195.53812"
+       rx="3.187856"
+       ry="3.187856" />
+  </g>
+</svg>
diff --git a/same-gnome-clutter/data/themes/test/green.svg b/same-gnome-clutter/data/themes/test/green.svg
new file mode 100644
index 0000000..6950094
--- /dev/null
+++ b/same-gnome-clutter/data/themes/test/green.svg
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="50"
+   height="50"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="green.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.0">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient3179">
+      <stop
+         style="stop-color:#549515;stop-opacity:0.96078432;"
+         offset="0"
+         id="stop3181" />
+      <stop
+         style="stop-color:#8ae234;stop-opacity:1;"
+         offset="1"
+         id="stop3183" />
+    </linearGradient>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3179"
+       id="linearGradient3193"
+       x1="164.71428"
+       y1="344.79077"
+       x2="315.28571"
+       y2="344.79077"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.3187856,0,0,0.3187856,113.20576,133.30501)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="4.310224"
+     inkscape:cx="46.168896"
+     inkscape:cy="75.285713"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1440"
+     inkscape:window-height="842"
+     inkscape:window-x="0"
+     inkscape:window-y="0" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-164.71428,-194.21933)">
+    <rect
+       style="opacity:1;fill:url(#linearGradient3193);fill-opacity:1;stroke:#8ae234;stroke-width:0.63757122;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3157"
+       width="47.362427"
+       height="47.362431"
+       x="166.03307"
+       y="195.53812"
+       rx="3.187856"
+       ry="3.187856" />
+  </g>
+</svg>
diff --git a/same-gnome-clutter/data/themes/test/red.svg b/same-gnome-clutter/data/themes/test/red.svg
new file mode 100644
index 0000000..e864f62
--- /dev/null
+++ b/same-gnome-clutter/data/themes/test/red.svg
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="50"
+   height="50"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="red.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.0">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient3179">
+      <stop
+         style="stop-color:#ee8f04;stop-opacity:0.96078432;"
+         offset="0"
+         id="stop3181" />
+      <stop
+         style="stop-color:#fcae3f;stop-opacity:0.96078432;"
+         offset="1"
+         id="stop3183" />
+    </linearGradient>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3179"
+       id="linearGradient3193"
+       x1="164.71428"
+       y1="344.79077"
+       x2="315.28571"
+       y2="344.79077"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.3187856,0,0,0.3187856,113.20576,133.30501)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="12.26"
+     inkscape:cx="14.763458"
+     inkscape:cy="25"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1440"
+     inkscape:window-height="842"
+     inkscape:window-x="0"
+     inkscape:window-y="0" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-164.71428,-194.21933)">
+    <rect
+       style="opacity:1;fill:url(#linearGradient3193);fill-opacity:1;stroke:#fcaf3e;stroke-width:0.63757122;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3157"
+       width="47.362427"
+       height="47.362431"
+       x="166.03307"
+       y="195.53812"
+       rx="3.187856"
+       ry="3.187856" />
+  </g>
+</svg>
diff --git a/same-gnome-clutter/data/themes/test/theme.js b/same-gnome-clutter/data/themes/test/theme.js
new file mode 100644
index 0000000..87c2237
--- /dev/null
+++ b/same-gnome-clutter/data/themes/test/theme.js
@@ -0,0 +1,12 @@
+ThemeLoader = imports.ThemeLoader;
+
+var name = "Test Theme";
+
+var colors = [ ThemeLoader.load_svg("test", "blue.svg"),
+               ThemeLoader.load_svg("test", "green.svg"),
+               ThemeLoader.load_svg("test", "red.svg"),
+               ThemeLoader.load_svg("test", "yellow.svg") ];
+
+var loaded = false;
+var textures = [colors[0], colors[1], colors[2], colors[3]];
+
diff --git a/same-gnome-clutter/data/themes/test/yellow.svg b/same-gnome-clutter/data/themes/test/yellow.svg
new file mode 100644
index 0000000..90ec365
--- /dev/null
+++ b/same-gnome-clutter/data/themes/test/yellow.svg
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="50"
+   height="50"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="yellow.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.0">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient3179">
+      <stop
+         style="stop-color:#dec604;stop-opacity:0.96078432;"
+         offset="0"
+         id="stop3181" />
+      <stop
+         style="stop-color:#fce94f;stop-opacity:1;"
+         offset="1"
+         id="stop3183" />
+    </linearGradient>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3179"
+       id="linearGradient3193"
+       x1="164.71428"
+       y1="344.79077"
+       x2="315.28571"
+       y2="344.79077"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.3187856,0,0,0.3187856,113.20576,133.30501)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.5325"
+     inkscape:cx="-12.236982"
+     inkscape:cy="-5.5115365"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1440"
+     inkscape:window-height="842"
+     inkscape:window-x="0"
+     inkscape:window-y="0" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-164.71428,-194.21933)">
+    <rect
+       style="opacity:1;fill:url(#linearGradient3193);fill-opacity:1;stroke:#fce94f;stroke-width:0.63757122;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3157"
+       width="47.362427"
+       height="47.362431"
+       x="166.03307"
+       y="195.53812"
+       rx="3.187856"
+       ry="3.187856" />
+  </g>
+</svg>
diff --git a/same-gnome-clutter/src/Board.js b/same-gnome-clutter/src/Board.js
index 4dda59d..2a12f69 100644
--- a/same-gnome-clutter/src/Board.js
+++ b/same-gnome-clutter/src/Board.js
@@ -143,6 +143,11 @@ Board = new GType({
 			return false;
 		}
 		
+		function colors_changed()
+		{
+			self.new_game();
+		}
+		
 		// Public
 		this.has_completed = function ()
 		{
@@ -298,6 +303,8 @@ Board = new GType({
 		
 		// Implementation
 		this.reactive = true;
+		
+		Settings.Watcher.signal.colors_changed.connect(colors_changed);
 	}
 });
 	
diff --git a/same-gnome-clutter/src/Light.js b/same-gnome-clutter/src/Light.js
index b8f24c7..0eb0cb4 100644
--- a/same-gnome-clutter/src/Light.js
+++ b/same-gnome-clutter/src/Light.js
@@ -12,6 +12,11 @@ Light = new GType({
 	var closed = false;
 	var light_x, light_y;
 	var state = Math.floor(Math.random() * Settings.colors);
+	
+	function theme_changed()
+	{
+		on.source = Settings.theme.colors[state];
+	}
 		
 	// Public
 	this.visited = false;
@@ -106,6 +111,8 @@ Light = new GType({
 	this.set_anchor_point(main.tile_size / 2, main.tile_size / 2);
 	
 	this.add_actor(this.on);
+	
+	Settings.Watcher.signal.theme_changed.connect(theme_changed);
     }
 });
 
diff --git a/same-gnome-clutter/src/Settings.js b/same-gnome-clutter/src/Settings.js
index 6749fa9..b035a60 100644
--- a/same-gnome-clutter/src/Settings.js
+++ b/same-gnome-clutter/src/Settings.js
@@ -66,7 +66,7 @@ handlers = {
 	select_theme: function(selector, ud)
 	{
 		new_theme = themes[selector.get_active_text()];
-		
+
 		if(new_theme == theme)
 			return;
 		
@@ -112,7 +112,12 @@ handlers = {
 	},
 	update_size: function(widget, ud)
 	{
-		size = widget.get_active();
+		new_size = widget.get_active();
+		
+		if(new_size == size);
+			return;
+		
+		size = new_size;
 		
 		try
 		{
@@ -127,7 +132,12 @@ handlers = {
 	},
 	update_colors: function(widget, ud)
 	{
-		colors = widget.get_value();
+		new_colors = widget.get_value();
+		
+		if(new_colors == colors)
+			return;
+
+		colors = new_colors;
 
 		try
 		{
diff --git a/same-gnome-clutter/src/main.js b/same-gnome-clutter/src/main.js
index 2a1cc39..7c243af 100755
--- a/same-gnome-clutter/src/main.js
+++ b/same-gnome-clutter/src/main.js
@@ -64,7 +64,6 @@ var clutter_embed = b.get_object("clutter");
 var stage = clutter_embed.get_stage();
 
 var current_score = 0;
-var timelines = [];
 
 stage.signal.hide.connect(Gtk.main_quit);
 stage.set_use_fog(false);
@@ -79,6 +78,8 @@ stage.show_all();
 
 ThemeLoader.load_theme(stage, Settings.theme);
 
+//Settings.Watcher.signal.size_changed.connect(size_changed);
+
 var board = new Board.Board();
 stage.add_actor(board);
 board.show();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]