[gnome-builder] icons: fix alias for pattern svgs



commit b8bfcc542e1e664760e772da2931b84b2ba9fec3
Author: Christian Hergert <chergert redhat com>
Date:   Tue Sep 19 19:12:00 2017 -0700

    icons: fix alias for pattern svgs

 .../196x196/actions/pattern-browse.symbolic.png    |  Bin 571 -> 0 bytes
 .../196x196/actions/pattern-cli.symbolic.png       |  Bin 571 -> 0 bytes
 .../196x196/actions/pattern-gnome.symbolic.png     |  Bin 571 -> 0 bytes
 .../196x196/actions/pattern-grid.symbolic.png      |  Bin 571 -> 0 bytes
 .../196x196/actions/pattern-legacy.symbolic.png    |  Bin 713 -> 0 bytes
 .../196x196/actions/pattern-library.symbolic.png   |  Bin 571 -> 0 bytes
 .../294x294/actions/pattern-browse.symbolic.png    |  Bin 1058 -> 0 bytes
 .../294x294/actions/pattern-cli.symbolic.png       |  Bin 1058 -> 0 bytes
 .../294x294/actions/pattern-gnome.symbolic.png     |  Bin 1058 -> 0 bytes
 .../294x294/actions/pattern-grid.symbolic.png      |  Bin 1058 -> 0 bytes
 .../294x294/actions/pattern-legacy.symbolic.png    |  Bin 1200 -> 0 bytes
 .../294x294/actions/pattern-library.symbolic.png   |  Bin 1058 -> 0 bytes
 .../98x98/actions/pattern-browse.symbolic.png      |  Bin 324 -> 0 bytes
 .../hicolor/98x98/actions/pattern-cli.symbolic.png |  Bin 324 -> 0 bytes
 .../98x98/actions/pattern-gnome.symbolic.png       |  Bin 324 -> 0 bytes
 .../98x98/actions/pattern-grid.symbolic.png        |  Bin 324 -> 0 bytes
 .../98x98/actions/pattern-legacy.symbolic.png      |  Bin 427 -> 0 bytes
 .../98x98/actions/pattern-library.symbolic.png     |  Bin 324 -> 0 bytes
 data/icons/hicolor/icons.gresource.xml             |   24 +++++---------------
 data/icons/hicolor/render-symbolic.py              |   20 ++++++----------
 20 files changed, 14 insertions(+), 30 deletions(-)
---
diff --git a/data/icons/hicolor/icons.gresource.xml b/data/icons/hicolor/icons.gresource.xml
index 58f5626..1cdca9f 100644
--- a/data/icons/hicolor/icons.gresource.xml
+++ b/data/icons/hicolor/icons.gresource.xml
@@ -164,23 +164,11 @@
     <file>16x16/apps/org.gnome.Builder-symbolic.symbolic.png</file>
     <file>32x32/apps/org.gnome.Builder-symbolic.symbolic.png</file>
     <file>48x48/apps/org.gnome.Builder-symbolic.symbolic.png</file>
-    <file>98x98/actions/pattern-browse.symbolic.png</file>
-    <file>98x98/actions/pattern-cli.symbolic.png</file>
-    <file>98x98/actions/pattern-gnome.symbolic.png</file>
-    <file>98x98/actions/pattern-grid.symbolic.png</file>
-    <file>98x98/actions/pattern-legacy.symbolic.png</file>
-    <file>98x98/actions/pattern-library.symbolic.png</file>
-    <file>196x196/actions/pattern-browse.symbolic.png</file>
-    <file>196x196/actions/pattern-cli.symbolic.png</file>
-    <file>196x196/actions/pattern-gnome.symbolic.png</file>
-    <file>196x196/actions/pattern-grid.symbolic.png</file>
-    <file>196x196/actions/pattern-legacy.symbolic.png</file>
-    <file>196x196/actions/pattern-library.symbolic.png</file>
-    <file>294x294/actions/pattern-browse.symbolic.png</file>
-    <file>294x294/actions/pattern-cli.symbolic.png</file>
-    <file>294x294/actions/pattern-gnome.symbolic.png</file>
-    <file>294x294/actions/pattern-grid.symbolic.png</file>
-    <file>294x294/actions/pattern-legacy.symbolic.png</file>
-    <file>294x294/actions/pattern-library.symbolic.png</file>
+    <file alias="scalable/actions/pattern-legacy.svg">scalable/patterns/pattern-legacy.svg</file>
+    <file alias="scalable/actions/pattern-browse.svg">scalable/patterns/pattern-browse.svg</file>
+    <file alias="scalable/actions/pattern-library.svg">scalable/patterns/pattern-library.svg</file>
+    <file alias="scalable/actions/pattern-grid.svg">scalable/patterns/pattern-grid.svg</file>
+    <file alias="scalable/actions/pattern-cli.svg">scalable/patterns/pattern-cli.svg</file>
+    <file alias="scalable/actions/pattern-gnome.svg">scalable/patterns/pattern-gnome.svg</file>
   </gresource>
 </gresources>
diff --git a/data/icons/hicolor/render-symbolic.py b/data/icons/hicolor/render-symbolic.py
index c45d2e0..faa2a7f 100755
--- a/data/icons/hicolor/render-symbolic.py
+++ b/data/icons/hicolor/render-symbolic.py
@@ -1,9 +1,11 @@
 #!/usr/bin/env python3
 
 import os
+import shutil
 import sys
 
 _resources = {}
+_aliases = {}
 
 def addResource(directory, name):
     if directory not in _resources:
@@ -17,6 +19,10 @@ def gtkEncodeSymbolicSvg(outdir, path, size):
     print(cmd)
     os.system(cmd)
 
+# These just need to be aliased properly
+for name in os.listdir('scalable/patterns'):
+    _aliases[os.path.join('scalable/actions', name)] = os.path.join('scalable/patterns', name)
+
 # These need to be scaled as symbolic icons into
 # 16 and their 2x and 3x counterparts
 for dirname in ('actions', 'apps'):
@@ -28,18 +34,6 @@ for dirname in ('actions', 'apps'):
             symbolic_name = name[:-4] + '.symbolic.png'
             addResource(outdir, symbolic_name)
 
-# These need to be scaled as symbolic icons into
-# 98x98 and 2x/3x.
-for name in os.listdir('scalable/patterns'):
-    for size in (98, 196, 294):
-        outdir = '%dx%d/actions' % (size, size)
-        # GTK won't locate the icons in "patterns", so
-        # we instead put them in "actions".
-        path = os.path.join('scalable/patterns', name)
-        gtkEncodeSymbolicSvg(outdir, path, size)
-        symbolic_name = name[:-4] + '.symbolic.png'
-        addResource(outdir, symbolic_name)
-
 # Now generate our updated .gresources.xml
 with open("icons.gresource.xml", "w") as stream:
     stream.write('''<?xml version="1.0" encoding="UTF-8"?>
@@ -51,6 +45,8 @@ with open("icons.gresource.xml", "w") as stream:
         names.sort()
         for name in names:
             stream.write('    <file>%s/%s</file>\n' % (dirname, name))
+    for alias, name in _aliases.items():
+        stream.write('    <file alias="%s">%s</file>\n' % (alias, name))
     stream.write('''  </gresource>
 </gresources>
 ''')


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