Skip to content

Commit 2f52d4e

Browse files
Merge pull request #1212 from silx-kit/dark_coordinates
black text coordinates fix in dark mode
2 parents e241eb2 + 90cb0e5 commit 2f52d4e

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/PyMca5/PyMcaGui/pymca/ScanWindow.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,23 +580,25 @@ def graphCallback(self, ddict):
580580
'Y:%s '
581581
% (curs_xText, curs_yText, xText, yText))
582582
qt.QToolTip.showText(self.cursor().pos(), xy_tip)
583+
_defaultColor = qt.QApplication.instance().palette().color(qt.QPalette.Text).name()
583584
if xText == '----':
584585
if self.getGraphCursor():
585586
self._xPos.setStyleSheet("color: rgb(255, 0, 0);")
586587
self._yPos.setStyleSheet("color: rgb(255, 0, 0);")
587588
xText = curs_xText
588589
yText = curs_yText
589590
else:
590-
self._xPos.setStyleSheet("color: rgb(0, 0, 0);")
591-
self._yPos.setStyleSheet("color: rgb(0, 0, 0);")
591+
self._xPos.setStyleSheet("color: %s;" % _defaultColor)
592+
self._yPos.setStyleSheet("color: %s;" % _defaultColor)
592593
else:
593-
self._xPos.setStyleSheet("color: rgb(0, 0, 0);")
594-
self._yPos.setStyleSheet("color: rgb(0, 0, 0);")
594+
self._xPos.setStyleSheet("color: %s;" % _defaultColor)
595+
self._yPos.setStyleSheet("color: %s;" % _defaultColor)
595596
self._xPos.setText(xText)
596597
self._yPos.setText(yText)
597598
else:
598-
self._xPos.setStyleSheet("color: rgb(0, 0, 0);")
599-
self._yPos.setStyleSheet("color: rgb(0, 0, 0);")
599+
_defaultColor = qt.QApplication.instance().palette().color(qt.QPalette.Text).name()
600+
self._xPos.setStyleSheet("color: %s;" % _defaultColor)
601+
self._yPos.setStyleSheet("color: %s;" % _defaultColor)
600602
self._handleMouseMovedEvent(ddict)
601603
elif ddict['event'] in ["curveClicked", "legendClicked"]:
602604
legend = ddict["label"]

0 commit comments

Comments
 (0)