Skip to content

Commit 6957009

Browse files
committedJan 15, 2019
[themes] Fix the processing modeler's rendering on dark backgrounds
1 parent 2e36fd6 commit 6957009

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed
 

‎python/plugins/processing/modeler/ModelerArrowItem.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
QgsProcessingModelChildAlgorithm,
5151
QgsProcessingModelParameter)
5252
from qgis.PyQt.QtCore import Qt, QPointF
53-
from qgis.PyQt.QtWidgets import QGraphicsPathItem, QGraphicsItem
54-
from qgis.PyQt.QtGui import QPen, QPainterPath, QPolygonF, QPainter
53+
from qgis.PyQt.QtWidgets import QApplication, QGraphicsPathItem, QGraphicsItem
54+
from qgis.PyQt.QtGui import QPen, QPainterPath, QPolygonF, QPainter, QPalette
5555
from processing.modeler.ModelerGraphicItem import ModelerGraphicItem
5656

5757

@@ -67,7 +67,7 @@ def __init__(self, startItem, startIndex, endItem, endIndex,
6767
self.endItem = endItem
6868
self.endPoints = []
6969
self.setFlag(QGraphicsItem.ItemIsSelectable, False)
70-
self.myColor = Qt.gray
70+
self.myColor = QApplication.palette().color(QPalette.WindowText)
7171
self.setPen(QPen(self.myColor, 1, Qt.SolidLine,
7272
Qt.RoundCap, Qt.RoundJoin))
7373
self.setZValue(0)

‎python/plugins/processing/modeler/ModelerGraphicItem.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
import math
3131

3232
from qgis.PyQt.QtCore import Qt, QPointF, QRectF
33-
from qgis.PyQt.QtGui import QFont, QFontMetricsF, QPen, QBrush, QColor, QPolygonF, QPicture, QPainter
34-
from qgis.PyQt.QtWidgets import QGraphicsItem, QMessageBox, QMenu
33+
from qgis.PyQt.QtGui import QFont, QFontMetricsF, QPen, QBrush, QColor, QPolygonF, QPicture, QPainter, QPalette
34+
from qgis.PyQt.QtWidgets import QApplication, QGraphicsItem, QMessageBox, QMenu
3535
from qgis.PyQt.QtSvg import QSvgRenderer
3636
from qgis.core import (QgsProcessingParameterDefinition,
3737
QgsProcessingModelParameter,
@@ -328,7 +328,7 @@ def paint(self, painter, option, widget=None):
328328
h = fm.ascent()
329329
pt = QPointF(-ModelerGraphicItem.BOX_WIDTH / 2 + 25, ModelerGraphicItem.BOX_HEIGHT / 2.0 - h + 1)
330330
painter.drawText(pt, text)
331-
painter.setPen(QPen(Qt.black))
331+
painter.setPen(QPen(QApplication.palette().color(QPalette.WindowText)))
332332
if isinstance(self.element, QgsProcessingModelChildAlgorithm):
333333
h = -(fm.height() * 1.2)
334334
h = h - ModelerGraphicItem.BOX_HEIGHT / 2.0 + 5

‎resources/themes/Blend of Gray/palette.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0:#0e0e0e
12
2:#373737
23
5:#373737
34
9:#727272

‎resources/themes/Night Mapping/palette.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0:#aaaaaa
12
2:#535353
23
5:#222222
34
9:#535353

0 commit comments

Comments
 (0)
Please sign in to comment.