[gnome-mines/gnome-3-18] Show incorrectly flagged fields in all themes (bgo#757492).



commit 364e18c93cad6001f7cc5ee41d1baf213cc3c6a0
Author: Robert Roth <robert roth off gmail com>
Date:   Tue Nov 3 15:31:43 2015 +0200

    Show incorrectly flagged fields in all themes (bgo#757492).
    
    Updated the code and images with a separate image for incorrect flag (per theme),
    so a theme can now set both the image and the background for incorrectly flagged fields.
    * coloured background theme only sets the background to red
    * the default theme only sets the image to a red version of the flag
    * the classic theme sets the background.
    https://bugzilla.gnome.org/show_bug.cgi?id=757492

 data/themes/bgcolors/Makefile.am   |    2 +-
 data/themes/bgcolors/incorrect.svg |   90 ++++++++++++++++++++
 data/themes/classic/Makefile.am    |    2 +-
 data/themes/classic/incorrect.svg  |  164 ++++++++++++++++++++++++++++++++++++
 data/themes/classic/theme.css      |    4 +
 data/themes/default/Makefile.am    |    2 +-
 data/themes/default/incorrect.svg  |   90 ++++++++++++++++++++
 src/tile.vala                      |    3 +-
 8 files changed, 353 insertions(+), 4 deletions(-)
---
diff --git a/data/themes/bgcolors/Makefile.am b/data/themes/bgcolors/Makefile.am
index 2438227..6d32601 100644
--- a/data/themes/bgcolors/Makefile.am
+++ b/data/themes/bgcolors/Makefile.am
@@ -2,7 +2,7 @@ themedir   = $(pkgdatadir)/themes/bgcolors
 theme_DATA = mine.svg exploded.svg overmine.svg \
             1mines.svg 2mines.svg 3mines.svg 4mines.svg \
             5mines.svg 6mines.svg 7mines.svg 8mines.svg \
-            flag.svg maybe.svg theme.css
+            flag.svg maybe.svg incorrect.svg theme.css
 
 EXTRA_DIST = ${theme_DATA}
 
diff --git a/data/themes/bgcolors/incorrect.svg b/data/themes/bgcolors/incorrect.svg
new file mode 100644
index 0000000..ceb16a3
--- /dev/null
+++ b/data/themes/bgcolors/incorrect.svg
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   version="1.1"
+   width="64"
+   height="64"
+   id="svg9373"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="flag.svg">
+  <metadata
+     id="metadata9418">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs9416" />
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1600"
+     inkscape:window-height="834"
+     id="namedview9414"
+     showgrid="false"
+     inkscape:snap-nodes="false"
+     inkscape:snap-bbox="true"
+     inkscape:zoom="1"
+     inkscape:cx="37.101481"
+     inkscape:cy="14.748665"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg9373">
+    <inkscape:grid
+       type="xygrid"
+       id="grid9641"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <linearGradient
+     id="paint"
+     gradientUnits="userSpaceOnUse"
+     x1="14.5"
+     y1="99"
+     x2="119.5"
+     y2="99">
+    <stop
+       offset="0"
+       style="stop-color:#DA1800"
+       id="stop9404" />
+    <stop
+       offset="0.33"
+       style="stop-color:#B42D2D"
+       id="stop9406" />
+    <stop
+       offset="0.66"
+       style="stop-color:#FA1818"
+       id="stop9408" />
+    <stop
+       offset="1"
+       style="stop-color:#B42D2D"
+       id="stop9410" />
+  </linearGradient>
+  <path
+     style="fill:#2e3436;fill-opacity:1;stroke-width:1;stroke-miterlimit:4"
+     d="M 8.086319,0.175024 17.084785,0 l 0,3.104056 L 58.104384,20.741065 17.040446,38.378074 16.99727,64 
8,64 z"
+     id="path9621"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="cccccccc" />
+</svg>
diff --git a/data/themes/classic/Makefile.am b/data/themes/classic/Makefile.am
index 77a3477..d7bb84c 100644
--- a/data/themes/classic/Makefile.am
+++ b/data/themes/classic/Makefile.am
@@ -2,7 +2,7 @@ themedir   = $(pkgdatadir)/themes/classic
 theme_DATA = mine.svg exploded.svg overmine.svg \
             1mines.svg 2mines.svg 3mines.svg 4mines.svg \
             5mines.svg 6mines.svg 7mines.svg 8mines.svg \
-            flag.svg maybe.svg theme.css
+            flag.svg maybe.svg incorrect.svg theme.css
 
 EXTRA_DIST = ${theme_DATA}
 
diff --git a/data/themes/classic/incorrect.svg b/data/themes/classic/incorrect.svg
new file mode 100644
index 0000000..783af90
--- /dev/null
+++ b/data/themes/classic/incorrect.svg
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   version="1.1"
+   width="161"
+   height="161"
+   id="svg2"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="incorrect.svg">
+  <metadata
+     id="metadata47">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs45" />
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1869"
+     inkscape:window-height="1016"
+     id="namedview43"
+     showgrid="false"
+     inkscape:zoom="4.1460174"
+     inkscape:cx="27.679234"
+     inkscape:cy="96.444192"
+     inkscape:window-x="1971"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg2" />
+  <rect
+     x="102.67"
+     y="19"
+     fill="#777777"
+     stroke="#000000"
+     stroke-width="3"
+     width="36.67"
+     height="8"
+     id="rect4" />
+  <rect
+     x="98.67"
+     y="60"
+     fill="#777777"
+     stroke="#000000"
+     stroke-width="3"
+     width="42.31"
+     height="8"
+     id="rect6" />
+  <rect
+     x="94.67"
+     y="99"
+     fill="#777777"
+     stroke="#000000"
+     stroke-width="3"
+     width="50.9"
+     height="8"
+     id="rect8" />
+  <polygon
+     fill="#404040"
+     points="151.64,126.87 144.6,126.87 132.03,27.19 139.07,27.19"
+     id="polygon10" />
+  <polygon
+     fill="#777777"
+     points="148.1,127.17 144.6,126.87 132.03,27.19 135.53,27.48"
+     id="polygon12" />
+  <polygon
+     fill="none"
+     stroke="#000000"
+     stroke-width="3"
+     points="151.64,126.87 144.6,126.87 132.03,27.19 139.07,27.19"
+     id="polygon14" />
+  <polygon
+     fill="#404040"
+     points="90.86,126.87 97.9,126.87 110.47,27.19 103.43,27.19"
+     id="polygon16" />
+  <polygon
+     fill="#777777"
+     points="90.86,126.87 94.9,126.87 107.47,27.19 103.43,27.19"
+     id="polygon18" />
+  <polygon
+     fill="none"
+     stroke="#000000"
+     stroke-width="3"
+     points="90.86,126.87 97.9,126.87 110.47,27.19 103.43,27.19"
+     id="polygon20" />
+  <path
+     fill="#404040"
+     stroke="#404040"
+     
d="M154.18,121.94h-5.24c0,0,0.98,24.81-4.89,24.81c-5.87,0-44.99,0-50.86,0c-4.33,0-4.93-13.47-4.95-20.56c-0.02,8.28,0.51,25.81,5.38,25.81c6.38,0,48.87,0,55.24,0C155.25,152,154.18,121.94,154.18,121.94z"
+     id="path22" />
+  <path
+     fill="#777777"
+     stroke="#777777"
+     
d="M93.2,146.75c5.87,0,44.99,0,50.86,0c5.87,0,4.89-24.81,4.89-24.81H88.32h-0.01c0,0-0.07,1.72-0.06,4.25C88.27,133.27,88.88,146.75,93.2,146.75z"
+     id="path24" />
+  <path
+     fill="none"
+     stroke="#000000"
+     stroke-width="3.5"
+     
d="M93.63,152c6.38,0,48.87,0,55.24,0c6.37,0,5.31-30.06,5.31-30.06H88.32C88.32,121.94,87.25,152,93.63,152z"
+     id="path26" />
+  <rect
+     x="118.5"
+     y="23"
+     fill="#777777"
+     stroke="#000000"
+     stroke-width="2"
+     width="7"
+     height="80"
+     id="rect28" />
+  <path
+     fill="#FFFFFF"
+     d="M91.57,137.06c-1.31-13.13-1.31-13.43,24.89-11.81C91.57,127.16,93.48,125.55,91.57,137.06z"
+     id="path30" />
+  <linearGradient
+     id="paint"
+     gradientUnits="userSpaceOnUse"
+     x1="14.5"
+     y1="99"
+     x2="119.5"
+     y2="99">
+    <stop
+       offset="0"
+       style="stop-color:#DA1800"
+       id="stop33" />
+    <stop
+       offset="0.33"
+       style="stop-color:#B42D2D"
+       id="stop35" />
+    <stop
+       offset="0.66"
+       style="stop-color:#FA1818"
+       id="stop37" />
+    <stop
+       offset="1"
+       style="stop-color:#B42D2D"
+       id="stop39" />
+  </linearGradient>
+  <path
+     fill="url(#paint)"
+     stroke="#000000"
+     stroke-width="6"
+     
d="M67.35,13.97c-13.99,13.43-51.85,0-51.85,0V60.6v47.93c0,0,37.86,13.43,51.85,0c14-13.43,53.15,0,53.15,0V60.6V13.97C120.5,13.97,81.35,0.54,67.35,13.97z"
+     id="path41" />
+</svg>
diff --git a/data/themes/classic/theme.css b/data/themes/classic/theme.css
index d0fc5c3..f997fce 100644
--- a/data/themes/classic/theme.css
+++ b/data/themes/classic/theme.css
@@ -7,3 +7,7 @@
 .explodedField .exploded {
   background-color:#d3d7cf;
 }
+
+.explodedField .incorrect {
+  background-color:#cc0000;
+}
diff --git a/data/themes/default/Makefile.am b/data/themes/default/Makefile.am
index c810ed7..6ce881f 100644
--- a/data/themes/default/Makefile.am
+++ b/data/themes/default/Makefile.am
@@ -2,7 +2,7 @@ themedir   = $(pkgdatadir)/themes/default
 theme_DATA = mine.svg exploded.svg overmine.svg \
             1mines.svg 2mines.svg 3mines.svg 4mines.svg \
             5mines.svg 6mines.svg 7mines.svg 8mines.svg \
-            flag.svg maybe.svg theme.css
+            flag.svg maybe.svg incorrect.svg theme.css
 
 EXTRA_DIST = ${theme_DATA}
 
diff --git a/data/themes/default/incorrect.svg b/data/themes/default/incorrect.svg
new file mode 100644
index 0000000..1fe22c4
--- /dev/null
+++ b/data/themes/default/incorrect.svg
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   version="1.1"
+   width="64"
+   height="64"
+   id="svg9373"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="incorrect.svg">
+  <metadata
+     id="metadata9418">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs9416" />
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1869"
+     inkscape:window-height="1016"
+     id="namedview9414"
+     showgrid="false"
+     inkscape:snap-nodes="false"
+     inkscape:snap-bbox="true"
+     inkscape:zoom="1"
+     inkscape:cx="-138.89852"
+     inkscape:cy="12.748665"
+     inkscape:window-x="1971"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg9373">
+    <inkscape:grid
+       type="xygrid"
+       id="grid9641"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <linearGradient
+     id="paint"
+     gradientUnits="userSpaceOnUse"
+     x1="14.5"
+     y1="99"
+     x2="119.5"
+     y2="99">
+    <stop
+       offset="0"
+       style="stop-color:#DA1800"
+       id="stop9404" />
+    <stop
+       offset="0.33"
+       style="stop-color:#B42D2D"
+       id="stop9406" />
+    <stop
+       offset="0.66"
+       style="stop-color:#FA1818"
+       id="stop9408" />
+    <stop
+       offset="1"
+       style="stop-color:#B42D2D"
+       id="stop9410" />
+  </linearGradient>
+  <path
+     style="fill:#cc0000;fill-opacity:1;stroke-width:1;stroke-miterlimit:4"
+     d="M 8.086319,0.175024 17.084785,0 l 0,3.104056 L 58.104384,20.741065 17.040446,38.378074 16.99727,64 
8,64 z"
+     id="path9621"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="cccccccc" />
+</svg>
diff --git a/src/tile.vala b/src/tile.vala
index 6ead583..30391e8 100644
--- a/src/tile.vala
+++ b/src/tile.vala
@@ -5,7 +5,8 @@ public class Tile : Gtk.Button
     public signal void tile_mouse_over (int x, int y);
     public signal void tile_pressed (int x, int y, Gdk.EventButton event);
     public signal void tile_released (int x, int y, Gdk.EventButton event);
-    private static string[] IMAGE_CLASSES = {"mine", "flag", "maybe", "overmine",
+    private static string[] IMAGE_CLASSES = {"mine", "flag", "incorrect",
+                                             "maybe", "overmine",
                                              "exploded", "1mines", "2mines",
                                              "3mines", "4mines", "5mines",
                                              "6mines", "7mines", "8mines"};


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