Aleš Erjavec avatar Aleš Erjavec committed 0bcd5f5

Use white icons on black toolbar background.

Comments (0)

Files changed (12)

 recursive-include Orange/testing *
 recursive-include Orange/doc *
 
-recursive-include Orange/OrangeWidgets *.png *.gs *.vs *.obj *.html
-recursive-include Orange/OrangeCanvas *.png *.pyw *.txt
+recursive-include Orange/OrangeWidgets *.png *.svg *.gs *.vs *.obj *.html
+recursive-include Orange/OrangeCanvas *.png *.svg *.qss *.pyw *.txt
 recursive-include Orange/orng *.cfg *.c
 
 recursive-include source *.bat *.c *.cpp *.h *.hpp *.mak COPYRIGHT *.py *.txt *.sip *.defs *.cmake Makefile

Orange/OrangeCanvas/application/canvasmain.py

 )
 
 from PyQt4.QtCore import (
-    Qt, QEvent, QSize, QUrl, QSettings, QTimer
+    Qt, QEvent, QSize, QUrl, QSettings, QTimer, QFile
 )
 
 from PyQt4.QtCore import pyqtProperty as Property
 def canvas_icons(name):
     """Return the named canvas icon.
     """
-    return QIcon(pkg_resources.resource_filename(
-                  config.__name__,
-                  os.path.join("icons", name))
-                 )
-
+    icon_file = QFile("canvas_icons:" + name)
+    if icon_file.exists():
+        return QIcon("canvas_icons:" + name)
+    else:
+        return QIcon(pkg_resources.resource_filename(
+                      config.__name__,
+                      os.path.join("icons", name))
+                     )
 
 def message_critical(text, title=None, informative_text=None, details=None,
                      buttons=None, default_button=None, exc_info=False,
         # Canvas Dock actions
         self.canvas_zoom_action = \
             QAction(self.tr("Zoom"), self,
-                    objectName="canvas-zoom-actions",
+                    objectName="canvas-zoom-action",
                     checkable=True,
                     shortcut=QKeySequence.ZoomIn,
                     toolTip=self.tr("Zoom in the scheme."),

Orange/OrangeCanvas/main.py

 
 import os
 import sys
+import re
 import logging
 import optparse
 import cPickle
 import pkg_resources
 
 from PyQt4.QtGui import QFont, QColor
-from PyQt4.QtCore import QRect, QSettings
+from PyQt4.QtCore import QRect, QSettings, QDir
 
 from Orange import OrangeCanvas
 from Orange.OrangeCanvas.application.application import CanvasApplication
 from Orange.OrangeCanvas.application.canvasmain import CanvasMainWindow
 
 from Orange.OrangeCanvas.gui.splashscreen import SplashScreen, QPixmap
-from Orange.OrangeCanvas.config import open_config, cache_dir
+from Orange.OrangeCanvas.config import cache_dir
 from Orange.OrangeCanvas import config
 from Orange.OrangeCanvas.utils.redirect import redirect_stdout, redirect_stderr
 
 
             pkg_name = OrangeCanvas.__name__
             resource = os.path.join("styles", stylesheet)
+
             if pkg_resources.resource_exists(pkg_name, resource):
                 stylesheet_string = pkg_resources.resource_string(
                                         pkg_name, resource)
+                base = pkg_resources.resource_filename(pkg_name, "styles")
+
+                matches = re.findall(
+                    r"^\s@([a-zA-Z0-9_]+?)=([a-zA-Z0-9_/]+?)$",
+                    stylesheet_string,
+                    re.MULTILINE)
+
+                for prefix, search_path in matches:
+                    QDir.addSearchPath(prefix, os.path.join(base, search_path))
+                    log.info("Adding search path %r for prefix, %r",
+                             search_path, prefix)
             else:
                 log.info("%r style sheet not found.", stylesheet)
 
     if stylesheet_string is not None:
         app.setStyleSheet(stylesheet_string)
 
+    # Add the default canvas_icons search path
+    dirpath = os.path.abspath(os.path.dirname(OrangeCanvas.__file__))
+    QDir.addSearchPath("canvas_icons", os.path.join(dirpath, "icons"))
+
     canvas_window = CanvasMainWindow()
     canvas_window.resize(1024, 650)
 

Orange/OrangeCanvas/styles/orange.qss

 /*  Default Orange stylesheet
  */
 
+/*
+ * Icon search paths relative to this files directory.
+ * (main.py script will add this to QDir.searchPaths)
+ */
+
+@canvas_icons=orange
 
 CanvasMainWindow {
     background-color: #E9EFF2;
Add a comment to this file

Orange/OrangeCanvas/styles/orange/Arrow.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="48px" height="48px" viewBox="0 0 48 48" enable-background="new 0 0 48 48" xml:space="preserve">
+<g fill="white">
+	<polygon points="42,12.753 30.75,3.751 11.172,33.768 7.449,30.751 6,44.249 18.898,40.028 15.324,37.133 "/>
+</g>
+</svg>
Add a comment to this file

Orange/OrangeCanvas/styles/orange/Document Info.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="48px" height="48px" viewBox="0 0 48 48" enable-background="new 0 0 48 48" xml:space="preserve">
+<g fill="white">
+	<path d="M27.999,6H13.001H11v2v32v2h2.001h22.002H37v-2V16v-2.002L27.999,6z M13.001,40V8h11.998c2.001,0,3,4.001,2.001,8
+		c0,0,8.003-3.124,8.003,0.998V40H13.001z"/>
+	<g>
+		<path d="M19.99,27.094c0.03-0.77,0.331-1.953,0.659-2.533c0.718-0.329,1.959-0.55,3.145-0.55c0.719,0,1.708,0.108,2.176,0.302
+			v10.743c0.578,0.081,1.487,0.274,1.955,0.495c0.085,0.302,0.136,0.965,0.136,1.541c0,0.223,0,0.414-0.025,0.607h-8.096
+			c0.051-0.661,0.246-1.57,0.438-2.01c0.387-0.305,1.05-0.578,1.599-0.771v-7.824H19.99z"/>
+		<path d="M26.433,19.401c0,1.904-1.16,2.967-2.801,2.967c-1.869,0-2.87-1.033-2.87-2.967c0-1.677,1.194-2.772,2.87-2.772
+			C25.272,16.629,26.433,17.63,26.433,19.401z"/>
+	</g>
+</g>
+</svg>
Add a comment to this file

Orange/OrangeCanvas/styles/orange/Grid.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="48px" height="48px" viewBox="0 0 48 48" enable-background="new 0 0 48 48" xml:space="preserve">
+<g fill="white">
+	<g>
+		<rect x="6" y="14.572" width="36" height="3.429"/>
+		<rect x="6" y="29.939" width="36" height="3.427"/>
+		<rect x="14.572" y="6" width="3.43" height="36"/>
+		<rect x="30.003" y="6" width="3.425" height="36"/>
+	</g>
+	<path d="M20.572,16.284c0,2.369-1.916,4.288-4.287,4.288c-2.367,0-4.285-1.919-4.285-4.288c0-2.362,1.918-4.283,4.285-4.283
+		C18.656,12.001,20.572,13.922,20.572,16.284z"/>
+	<path d="M36,16.284c0,2.369-1.918,4.288-4.285,4.288s-4.287-1.919-4.287-4.288c0-2.362,1.92-4.283,4.287-4.283S36,13.922,36,16.284
+		z"/>
+	<path d="M20.572,31.651c0,2.37-1.916,4.288-4.287,4.288c-2.367,0-4.285-1.918-4.285-4.288c0-2.364,1.918-4.283,4.285-4.283
+		C18.656,27.368,20.572,29.287,20.572,31.651z"/>
+	<path d="M36,31.651c0,2.37-1.918,4.288-4.285,4.288s-4.287-1.918-4.287-4.288c0-2.364,1.92-4.283,4.287-4.283S36,29.287,36,31.651z
+		"/>
+</g>
+</svg>
Add a comment to this file

Orange/OrangeCanvas/styles/orange/Info.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="48px" height="48px" viewBox="0 0 48 48" enable-background="new 0 0 48 48" xml:space="preserve">
+<path fill="white" d="M24,6C14.06,6,6,14.06,6,24.002C6,33.942,14.06,42,24,42s18-8.058,18-17.998C42,14.06,33.94,6,24,6z M24,38.897
+	c-8.215,0-14.897-6.683-14.897-14.896c0-8.215,6.683-14.897,14.897-14.897c8.21,0,14.896,6.683,14.896,14.897
+	C38.896,32.215,32.21,38.897,24,38.897z M21.852,35.804h4.63v-4.479h-4.63V35.804z M29.591,14.406
+	c-1.543-1.118-3.481-1.675-5.818-1.675c-1.776,0-3.272,0.394-4.492,1.178c-1.934,1.228-2.96,3.314-3.085,6.26h4.477
+	c0-0.858,0.253-1.683,0.75-2.478c0.504-0.797,1.35-1.194,2.543-1.194c1.216,0,2.053,0.323,2.512,0.969
+	c0.459,0.646,0.691,1.36,0.691,2.145c0,0.682-0.207,1.307-0.619,1.876c-0.228,0.329-0.527,0.636-0.895,0.914l-1.13,0.884
+	c-1.111,0.866-1.802,1.634-2.07,2.299c-0.266,0.667-0.434,1.874-0.495,3.619h4.199c0.013-0.827,0.081-1.435,0.199-1.828
+	c0.196-0.62,0.595-1.162,1.192-1.627l1.096-0.853c1.111-0.867,1.866-1.581,2.257-2.138c0.667-0.918,1.001-2.051,1.001-3.394
+	C31.905,17.173,31.135,15.52,29.591,14.406z"/>
+</svg>
Add a comment to this file

Orange/OrangeCanvas/styles/orange/Pause.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="48px" height="48px" viewBox="0 0 48 48" enable-background="new 0 0 48 48" xml:space="preserve">
+<g fill="white">
+	<path d="M9.656,6v36h9.56V6H9.656z"/>
+	<path d="M28.784,6v36h9.56V6H28.784z"/>
+</g>
+</svg>
Add a comment to this file

Orange/OrangeCanvas/styles/orange/Search.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="48px" height="48px" viewBox="0 0 48 48" enable-background="new 0 0 48 48" xml:space="preserve">
+<g fill="white">
+	<path d="M9.217,9.213C7.143,11.284,6.004,14.039,6,16.971c0.004,2.933,1.143,5.686,3.217,7.757
+		c2.069,2.072,4.824,3.213,7.757,3.213c2.932,0,5.687-1.141,7.761-3.213c4.275-4.275,4.271-11.235-0.005-15.515
+		C20.45,4.936,13.492,4.936,9.217,9.213z M21.99,11.954c1.336,1.337,2.074,3.12,2.074,5.015c0,1.899-0.742,3.681-2.078,5.02
+		c-2.763,2.764-7.263,2.762-10.03-0.002c-1.34-1.335-2.073-3.116-2.073-5.013c0-1.899,0.733-3.681,2.073-5.018l0.004-0.002
+		c1.336-1.338,3.116-2.074,5.018-2.074C18.87,9.88,20.655,10.616,21.99,11.954z"/>
+	<path d="M27.345,27.341c-0.485,0.487-1.015,0.919-1.564,1.281l-1.243,0.82l11.535,11.537c1.355,1.354,3.558,1.355,4.913,0.002
+		C41.639,40.325,42,39.451,42,38.524c0-0.929-0.361-1.799-1.015-2.45L29.446,24.535l-0.822,1.239
+		C28.255,26.334,27.83,26.857,27.345,27.341z"/>
+</g>
+</svg>
Add a comment to this file

Orange/OrangeCanvas/styles/orange/Text Size.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="48px" height="48px" viewBox="0 0 48 48" enable-background="new 0 0 48 48" xml:space="preserve">
+<g fill="white">
+	<path d="M28.34,38.09c1.755,0.114,4.137,0.453,5.607,0.793c0.398,1.248,0.508,4.023,0.285,5.215H13.539
+		c0.115-1.417,0.855-3.913,1.362-5.044c1.077-0.34,3.402-0.793,4.702-0.964V9.233h-6.291c-0.109,1.191-0.451,3.457-0.736,4.591
+		c-2.04,0.679-4.645,0.795-6.576,0.795V3.902h36v10.886c-2.154,0-4.707-0.226-6.633-0.793c-0.342-1.248-0.68-3.402-0.793-4.762
+		H28.34V38.09z"/>
+</g>
+</svg>
              all_with_extension(path="doc/datasets", extensions=("tab", "csv", "basket")) +\
              all_with_extension(path="doc/networks", extensions=("net", "tab")) +\
              all_with_extension(path="testing/regression/tests_20", extensions=("net", "tab", "basket", "csv")),
-        "Orange.OrangeCanvas": ["icons/*.png", "orngCanvas.pyw", "WidgetTabs.txt"],
-        "Orange.OrangeWidgets": ["icons/*.png", "icons/backgrounds/*.png", "report/index.html"],
-        "Orange.OrangeWidgets.Associate": ["icons/*.png"],
-        "Orange.OrangeWidgets.Classify": ["icons/*.png"],
-        "Orange.OrangeWidgets.Data": ["icons/*.png"],
-        "Orange.OrangeWidgets.Evaluate": ["icons/*.png"],
-        "Orange.OrangeWidgets.Prototypes": ["icons/*.png"],
-        "Orange.OrangeWidgets.Regression": ["icons/*.png"],
-        "Orange.OrangeWidgets.Unsupervised": ["icons/*.png"],
-        "Orange.OrangeWidgets.Visualize": ["icons/*.png"],
-        "Orange.OrangeWidgets.Visualize Qt": ["icons/*.png"],
+        "Orange.OrangeCanvas": ["icons/*.png", "icons/*.svg",
+                                "orngCanvas.pyw", "WidgetTabs.txt"],
+        "Orange.OrangeCanvas.styles": ["*.qss", "orange/*.svg"],
+        "Orange.OrangeWidgets": ["icons/*.png", "icons/backgrounds/*.png",
+                                 "report/index.html"],
+        "Orange.OrangeWidgets.Associate": ["icons/*.png", "icons/*.svg"],
+        "Orange.OrangeWidgets.Classify": ["icons/*.png", "icons/*.svg"],
+        "Orange.OrangeWidgets.Data": ["icons/*.png", "icons/*.svg"],
+        "Orange.OrangeWidgets.Evaluate": ["icons/*.png", "icons/*.svg"],
+        "Orange.OrangeWidgets.Prototypes": ["icons/*.png", "icons/*.svg"],
+        "Orange.OrangeWidgets.Regression": ["icons/*.png", "icons/*.svg"],
+        "Orange.OrangeWidgets.Unsupervised": ["icons/*.png", "icons/*.svg"],
+        "Orange.OrangeWidgets.Visualize": ["icons/*.png", "icons/*.svg"],
+        "Orange.OrangeWidgets.Visualize Qt": ["icons/*.png", "icons/*.svg"],
         "Orange.OrangeWidgets.plot": ["*.gs", "*.vs"],
         "Orange.OrangeWidgets.plot.primitives": ["*.obj"],
     }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.