Skip to content

Commit 3b9a9d8

Browse files
Merge pull request #1215 from silx-kit/fix_colors
switch from BrightText to Link because on Linux BrightText is white no matter the OS theme
2 parents 87ba057 + c3c903f commit 3b9a9d8

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/PyMca5/PyMcaGui/io/hdf5/HDF5Widget.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ def __init__(self, ffile, node, parent=None, path=None):
320320
#self._attrs = []
321321
# get the default text foreground color
322322
foregroundTextColor = qt.QApplication.instance().palette().color(qt.QPalette.Text)
323-
NXdataColor = qt.QApplication.instance().palette().color(qt.QPalette.BrightText)
323+
# qt.QPalette.Link is used to indicate action possibility (it is not actual link). BrightText and HighlightedText are not good.
324+
NXdataColor = qt.QApplication.instance().palette().color(qt.QPalette.Link)
324325
self._color = qt.QColor(foregroundTextColor)
325326
if hasattr(node, 'attrs'):
326327
attrs = list(node.attrs)
@@ -521,7 +522,8 @@ def data(self, index, role):
521522
elif role == qt.Qt.ToolTipRole:
522523
item = self.getProxyFromIndex(index)
523524
if hasattr(item, "color"):
524-
if item.color == qt.QApplication.instance().palette().color(qt.QPalette.BrightText) or item.color == qt.Qt.blue:
525+
# qt.QPalette.Link is used to indicate action possibility (it is not actual link). BrightText and HighlightedText are not good.
526+
if item.color == qt.QApplication.instance().palette().color(qt.QPalette.Link) or item.color == qt.Qt.blue:
525527
return MyQVariant("Item has a double click NXdata associated action")
526528
return MyQVariant()
527529
except Exception:

src/PyMca5/PyMcaGui/io/hdf5/QNexusWidget.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,8 @@ def hdf5Slot(self, ddict):
932932
shape = None
933933
self._shapeList.append(shape)
934934
self.cntTable.build(self._cntList, self._aliasList, shapelist=self._shapeList)
935-
elif (ddict['color'] == qt.QApplication.instance().palette().color(qt.QPalette.BrightText) or ddict['color'] == qt.Qt.blue) and ("silx" in sys.modules):
935+
# qt.QPalette.Link is used to indicate action possibility (it is not actual link). BrightText and HighlightedText are not good.
936+
elif (ddict['color'] == qt.QApplication.instance().palette().color(qt.QPalette.Link) or ddict['color'] == qt.Qt.blue) and ("silx" in sys.modules):
936937
# there is an action to be applied
937938
self.showInfoWidget(ddict["file"], ddict["name"], dset=False)
938939
elif ddict['type'] in ['NXentry', 'Entry']:

0 commit comments

Comments
 (0)