Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

silx.gui: Fixed PyQt6 support by not using deprecated qt.QPalette.Normal #3966

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/silx/gui/dialog/ColormapDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def _updateAutoScaleState(self, isAutoScale):
color = palette.color(qt.QPalette.Disabled, qt.QPalette.Base)
icon = self._iconAuto
else:
color = palette.color(qt.QPalette.Normal, qt.QPalette.Base)
color = palette.color(qt.QPalette.Active, qt.QPalette.Base)
icon = self._iconFixed
palette.setColor(qt.QPalette.Base, color)
self._numVal.setPalette(palette)
Expand Down Expand Up @@ -515,7 +515,7 @@ def _initPlot(self):
self._plot.setMinimumSize(qt.QSize(250, 200))
self._plot.sigPlotSignal.connect(self._plotEventReceived)
palette = self.palette()
color = palette.color(qt.QPalette.Normal, qt.QPalette.Window)
color = palette.color(qt.QPalette.Active, qt.QPalette.Window)
self._plot.setBackgroundColor(color)
self._plot.setDataBackgroundColor("white")

Expand Down
6 changes: 3 additions & 3 deletions src/silx/gui/plot/LegendSelector.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def data(self, modelIndex, role):
elif role == qt.Qt.BackgroundRole:
# Background color, must be QBrush
if isActive:
brush = self._palette.brush(qt.QPalette.Normal, qt.QPalette.Highlight)
brush = self._palette.brush(qt.QPalette.Active, qt.QPalette.Highlight)
elif idx % 2:
brush = qt.QBrush(qt.QColor(240, 240, 240))
else:
Expand All @@ -203,9 +203,9 @@ def data(self, modelIndex, role):
elif role == qt.Qt.ForegroundRole:
# ForegroundRole color, must be QBrush
if isActive:
brush = self._palette.brush(qt.QPalette.Normal, qt.QPalette.HighlightedText)
brush = self._palette.brush(qt.QPalette.Active, qt.QPalette.HighlightedText)
else:
brush = self._palette.brush(qt.QPalette.Normal, qt.QPalette.WindowText)
brush = self._palette.brush(qt.QPalette.Active, qt.QPalette.WindowText)
return brush
elif role == qt.Qt.CheckStateRole:
return bool(item[2]) # item[2] == True
Expand Down