2
0
mirror of https://github.com/m-labs/artiq.git synced 2025-01-31 12:50:20 +08:00

experiments: fix color dictionary handling

Signed-off-by: Florian Agbuya <fa@m-labs.ph>
This commit is contained in:
Florian Agbuya 2025-01-23 11:40:54 +08:00 committed by Sébastien Bourdeauducq
parent 415895413c
commit 7619dff08d

View File

@ -357,7 +357,7 @@ class _ExperimentDock(QtWidgets.QMdiSubWindow):
def apply_colors(self): def apply_colors(self):
colors = self.manager.get_colors(self.expurl) colors = self.manager.get_colors(self.expurl)
if colors is None: if not colors:
palette = QtWidgets.QApplication.palette() palette = QtWidgets.QApplication.palette()
colors = { colors = {
"window": palette.color(QtGui.QPalette.ColorRole.Window).name(), "window": palette.color(QtGui.QPalette.ColorRole.Window).name(),
@ -563,7 +563,7 @@ class ExperimentManager:
self.colors[expurl][key] = value self.colors[expurl][key] = value
def get_colors(self, expurl): def get_colors(self, expurl):
return self.colors.get(expurl) return self.colors.get(expurl, {})
def reset_colors(self, expurl): def reset_colors(self, expurl):
if expurl in self.colors: if expurl in self.colors: