Skip to content

Commit 8d1c0ad

Browse files
author
SuslikV
authored
Fix readonly text fields visibility (#3231)
Fixes an issue when read only fields of properties are hard to read on bright backgrounds of the Table of Properties for the system theme (not Dark one).
1 parent e247a9b commit 8d1c0ad

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/windows/views/properties_tableview.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ def paint(self, painter, option, index):
105105
else:
106106
painter.setBrush(QBrush(QColor("#3e3e3e")))
107107

108-
if not readonly:
108+
if readonly:
109+
# Set text color for read only fields
110+
painter.setPen(QPen(get_app().window.palette().color(QPalette.Disabled, QPalette.Text)))
111+
else:
109112
path = QPainterPath()
110113
path.addRoundedRect(QRectF(option.rect), 15, 15)
111114
painter.fillPath(path, QColor("#3e3e3e"))
@@ -135,8 +138,9 @@ def paint(self, painter, option, index):
135138
# Draw interpolation icon on top
136139
painter.drawPixmap(option.rect.x() + option.rect.width() - 30.0, option.rect.y() + 4, self.curve_pixmaps[interpolation])
137140

138-
# set text color
139-
painter.setPen(QPen(Qt.white))
141+
# Set text color
142+
painter.setPen(QPen(Qt.white))
143+
140144
value = index.data(Qt.DisplayRole)
141145
if value:
142146
painter.drawText(option.rect, Qt.AlignCenter, value)

0 commit comments

Comments
 (0)