def nag2ico(nag, tam): with open("./IntFiles/NAGs/Color/nag_%d.svg" % nag) as f: dato = f.read() color = getattr(VarGen.configuracion, "color_nag%d" % nag) dato = dato.replace("#3139ae", color) return QTVarios.svg2ico(dato, tam)
def iconoTema(tema, tam): svg = """<?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" version="1.1" width="388pt" height="388pt" viewBox="0 0 388 388" id="svg2"> <metadata id="metadata117"> <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="defs115" /> <g id="layer3" style="display:inline"> <rect width="486.81006" height="486.81006" x="0" y="-0.35689625" transform="scale(0.8,0.8)" id="rect4020" style="fill:FONDO;fill-opacity:1;fill-rule:nonzero;stroke:none" /> </g> <g id="layer1" style="display:inline"> <rect width="316.67606" height="317.12463" ry="0" x="35.708782" y="34.520344" id="rect3095" style="fill:WHITE;stroke:RECUADRO;stroke-width:4.54554987;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> </g> <g id="layer2" style="display:inline"> <rect width="38.841644" height="39.047188" x="154.92021" y="36.90279" id="rect3104" style="fill:BLACK;fill-opacity:1;stroke:BLACK;stroke-width:0.16;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> <use transform="translate(-78.883927,0)" id="use3887" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-118.64494,118.02342)" id="use3889" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-39.492576,196.10726)" id="use3891" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-118.64494,274.01176)" id="use3893" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(78.161342,3.0019919e-8)" id="use3903" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(156.08573,78.779427)" id="use3905" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-118.64494,196.10726)" id="use3907" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(38.395272,274.01176)" id="use3909" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(156.08573,3.0019984e-8)" id="use3919" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(0,78.779427)" id="use3921" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-78.883927,156.79797)" id="use3923" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-39.492576,274.01176)" id="use3925" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-118.64494,39.217809)" id="use3935" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(78.161342,78.779427)" id="use3937" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(0,156.79797)" id="use3939" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(0,235.54546)" id="use3941" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-39.492576,39.217809)" id="use3951" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-39.492576,118.02342)" id="use3953" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(38.395272,196.10726)" id="use3955" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(78.161342,235.54546)" id="use3957" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(38.395272,39.217809)" id="use3967" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(38.395272,118.02342)" id="use3969" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(78.161342,156.79797)" id="use3971" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(156.08573,235.54546)" id="use3973" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(116.52539,39.217809)" id="use3983" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(116.52539,118.02342)" id="use3985" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(116.52539,196.10726)" id="use3987" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(116.52539,274.01176)" id="use3989" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-78.883927,78.779427)" id="use3999" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(156.08573,156.79797)" id="use4001" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-78.883927,235.54546)" id="use4003" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> </g> </svg> """ confTema = ConfBoards.ConfigTabTema() confTema.restore_dic(tema["o_tema"]) thumbail = confTema.x_png64Thumb if thumbail: pm = QtGui.QPixmap() png = base64.b64decode(thumbail) pm.loadFromData(png) icono = QtGui.QIcon(pm) return icono def ccolor(ncolor): x = QtGui.QColor(ncolor) return x.name() svg = svg.replace("WHITE", ccolor(confTema.x_colorBlancas)) svg = svg.replace("BLACK", ccolor(confTema.x_colorNegras)) svg = svg.replace("FONDO", ccolor(confTema.x_colorExterior)) svg = svg.replace("RECUADRO", ccolor(confTema.x_colorFrontera)) return QTVarios.svg2ico(svg.encode("utf-8"), tam)
def nag2ico( nag, tam ): with open("IntFiles/NAGs/Color/nag_%d.svg"%nag) as f: dato = f.read() color = getattr(VarGen.configuracion,"color_nag%d"%nag) dato = dato.replace("#3139ae",color) return QTVarios.svg2ico(dato,tam)
def nag2ico(nag, tam): with open(Code.path_resource("IntFiles", "NAGs", "Color", "nag_%d.svg" % nag), "rb") as f: dato = f.read() color = getattr(Code.configuration, "x_color_nag%d" % nag) dato = dato.replace(b"#3139ae", color.encode()) return QTVarios.svg2ico(dato, tam)