Skip to content
Permalink
Browse files

[themes] Fix the processing modeler's rendering on dark backgrounds

  • Loading branch information
nirvn committed Jan 15, 2019
1 parent 2e36fd6 commit 6957009f8b35e6a4a50c20615a8c1742d2da860e
@@ -50,8 +50,8 @@
QgsProcessingModelChildAlgorithm,
QgsProcessingModelParameter)
from qgis.PyQt.QtCore import Qt, QPointF
from qgis.PyQt.QtWidgets import QGraphicsPathItem, QGraphicsItem
from qgis.PyQt.QtGui import QPen, QPainterPath, QPolygonF, QPainter
from qgis.PyQt.QtWidgets import QApplication, QGraphicsPathItem, QGraphicsItem
from qgis.PyQt.QtGui import QPen, QPainterPath, QPolygonF, QPainter, QPalette
from processing.modeler.ModelerGraphicItem import ModelerGraphicItem


@@ -67,7 +67,7 @@ def __init__(self, startItem, startIndex, endItem, endIndex,
self.endItem = endItem
self.endPoints = []
self.setFlag(QGraphicsItem.ItemIsSelectable, False)
self.myColor = Qt.gray
self.myColor = QApplication.palette().color(QPalette.WindowText)
self.setPen(QPen(self.myColor, 1, Qt.SolidLine,
Qt.RoundCap, Qt.RoundJoin))
self.setZValue(0)
@@ -30,8 +30,8 @@
import math

from qgis.PyQt.QtCore import Qt, QPointF, QRectF
from qgis.PyQt.QtGui import QFont, QFontMetricsF, QPen, QBrush, QColor, QPolygonF, QPicture, QPainter
from qgis.PyQt.QtWidgets import QGraphicsItem, QMessageBox, QMenu
from qgis.PyQt.QtGui import QFont, QFontMetricsF, QPen, QBrush, QColor, QPolygonF, QPicture, QPainter, QPalette
from qgis.PyQt.QtWidgets import QApplication, QGraphicsItem, QMessageBox, QMenu
from qgis.PyQt.QtSvg import QSvgRenderer
from qgis.core import (QgsProcessingParameterDefinition,
QgsProcessingModelParameter,
@@ -328,7 +328,7 @@ def paint(self, painter, option, widget=None):
h = fm.ascent()
pt = QPointF(-ModelerGraphicItem.BOX_WIDTH / 2 + 25, ModelerGraphicItem.BOX_HEIGHT / 2.0 - h + 1)
painter.drawText(pt, text)
painter.setPen(QPen(Qt.black))
painter.setPen(QPen(QApplication.palette().color(QPalette.WindowText)))
if isinstance(self.element, QgsProcessingModelChildAlgorithm):
h = -(fm.height() * 1.2)
h = h - ModelerGraphicItem.BOX_HEIGHT / 2.0 + 5
@@ -1,3 +1,4 @@
0:#0e0e0e
2:#373737
5:#373737
9:#727272
@@ -1,3 +1,4 @@
0:#aaaaaa
2:#535353
5:#222222
9:#535353

0 comments on commit 6957009

Please sign in to comment.
You can’t perform that action at this time.