Skip to content
Permalink
Browse files

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

  • Loading branch information
nirvn committed Jan 16, 2019
1 parent 710d568 commit 193ae4de1665dd564f277996f21fc4793d4edb66
@@ -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:#aaaaaa
2:#535353
5:#222222
9:#535353

0 comments on commit 193ae4d

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