From 664fdf447ab927a118486b271e426fb72666220a Mon Sep 17 00:00:00 2001 From: Maciej Bartkowiak Date: Fri, 3 May 2024 09:13:22 +0100 Subject: [PATCH] Remove hardcoded background colour in the GUI dialogs --- .../MDANSE_GUI/InputWidgets/InstrumentResolutionWidget.py | 3 --- MDANSE_GUI/Src/MDANSE_GUI/PeriodicTableViewer.py | 8 ++------ .../Src/MDANSE_GUI/Plotter/models/data_tree_model.py | 6 +----- MDANSE_GUI/Src/MDANSE_GUI/RegistryViewer.py | 3 --- MDANSE_GUI/Src/MDANSE_GUI/SubclassViewer.py | 3 --- 5 files changed, 3 insertions(+), 20 deletions(-) diff --git a/MDANSE_GUI/Src/MDANSE_GUI/InputWidgets/InstrumentResolutionWidget.py b/MDANSE_GUI/Src/MDANSE_GUI/InputWidgets/InstrumentResolutionWidget.py index bf7b1c5b1..78622b7b0 100644 --- a/MDANSE_GUI/Src/MDANSE_GUI/InputWidgets/InstrumentResolutionWidget.py +++ b/MDANSE_GUI/Src/MDANSE_GUI/InputWidgets/InstrumentResolutionWidget.py @@ -136,9 +136,6 @@ def get_widget_value(self): value = float(self._fields[index].text()) except ValueError: value = self._defaults[index] - self._fields[index].setStyleSheet( - "background-color:rgb(180,20,180); font-weight: bold" - ) else: self._fields[index].setStyleSheet("") params[key] = value diff --git a/MDANSE_GUI/Src/MDANSE_GUI/PeriodicTableViewer.py b/MDANSE_GUI/Src/MDANSE_GUI/PeriodicTableViewer.py index 8a199f33d..60d614a21 100644 --- a/MDANSE_GUI/Src/MDANSE_GUI/PeriodicTableViewer.py +++ b/MDANSE_GUI/Src/MDANSE_GUI/PeriodicTableViewer.py @@ -256,7 +256,7 @@ def setGroupStyleSheet(self): varbox_stylesheet = ( "QToolButton {background-color:rgb(" + text_rgb - + "); font-size: 20pt ; font-weight: bold}" + + "); font-size: 20pt ; font-weight: bold; font: ; color: rgb(20,0,0)}" ) self.setStyleSheet(varbox_stylesheet) @@ -328,7 +328,7 @@ def __init__(self, *args, **kwargs): self.fields = fields - stylesheet = "background-color:rgb(180,220,180); font-weight: bold" + stylesheet = "font-weight: bold" self.setStyleSheet(stylesheet) @Slot(object) @@ -377,10 +377,6 @@ def __init__(self, *args, **kwargs): self.placeElements() - self.setStyleSheet( - "QLabel {background-color:rgb(250,250,250); qproperty-alignment: AlignCenter}" - ) - def placeElements(self): for key, value in _LAYOUT.items(): element = ElementButton(self, element=key) diff --git a/MDANSE_GUI/Src/MDANSE_GUI/Plotter/models/data_tree_model.py b/MDANSE_GUI/Src/MDANSE_GUI/Plotter/models/data_tree_model.py index e2a8d848f..df07fe175 100644 --- a/MDANSE_GUI/Src/MDANSE_GUI/Plotter/models/data_tree_model.py +++ b/MDANSE_GUI/Src/MDANSE_GUI/Plotter/models/data_tree_model.py @@ -478,11 +478,7 @@ def data(self, index, role): else: data_root_item = self.get_data_root_item(node) variable_info = data_root_item.get_dataset_info(node.path, False) - return ( - QtGui.QColor("black") - if variable_info["plottable"] - else QtGui.QColor("red") - ) + return None if variable_info["plottable"] else QtGui.QColor("red") elif role == QtCore.Qt.ItemDataRole.ToolTipRole: node = index.internalPointer() diff --git a/MDANSE_GUI/Src/MDANSE_GUI/RegistryViewer.py b/MDANSE_GUI/Src/MDANSE_GUI/RegistryViewer.py index c84618694..f55a3e9a7 100644 --- a/MDANSE_GUI/Src/MDANSE_GUI/RegistryViewer.py +++ b/MDANSE_GUI/Src/MDANSE_GUI/RegistryViewer.py @@ -253,9 +253,6 @@ def __init__(self, *args, **kwargs): self.doc_panel = QTextEdit(self) self.glayout.addWidget(self.doc_panel, 3, 2, 1, 1) - self.setStyleSheet( - "QLabel {background-color:rgb(250,250,250); qproperty-alignment: AlignCenter}" - ) self.filter_field.textChanged.connect(self.filterEntries) self.viewer.clicked.connect(self.updateDocstring) diff --git a/MDANSE_GUI/Src/MDANSE_GUI/SubclassViewer.py b/MDANSE_GUI/Src/MDANSE_GUI/SubclassViewer.py index c3f3798fa..b0f66dae2 100644 --- a/MDANSE_GUI/Src/MDANSE_GUI/SubclassViewer.py +++ b/MDANSE_GUI/Src/MDANSE_GUI/SubclassViewer.py @@ -83,9 +83,6 @@ def __init__(self, *args, **kwargs): self.doc_panel = QTextEdit(self) self.glayout.addWidget(self.doc_panel, 3, 2, 1, 1) - self.setStyleSheet( - "QLabel {background-color:rgb(250,250,250); qproperty-alignment: AlignCenter}" - ) self.filter_field.textChanged.connect(self.filterEntries) self.viewer.clicked.connect(self.updateDocstring)