From 47ef932695d2e5208f785b7c1680518c6fd39e7c Mon Sep 17 00:00:00 2001 From: jupfi Date: Fri, 17 May 2024 16:32:10 +0200 Subject: [PATCH] Improved dark mode compatibility. --- src/nqrduck_broadband/view.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/nqrduck_broadband/view.py b/src/nqrduck_broadband/view.py index 3fbab82..c2407e1 100644 --- a/src/nqrduck_broadband/view.py +++ b/src/nqrduck_broadband/view.py @@ -105,6 +105,12 @@ class BroadbandView(ModuleView): self._ui_form.exportButton.clicked.connect(self.on_save_button_clicked) self._ui_form.importButton.clicked.connect(self.on_load_button_clicked) + @pyqtSlot() + def on_settings_changed(self) -> None: + """Redraw the plots in case the according settings have changed.""" + logger.debug("Settings changed.") + self.init_plots() + @pyqtSlot() def start_measurement_clicked(self) -> None: """This method is called when the start measurement button is clicked. @@ -160,14 +166,17 @@ class BroadbandView(ModuleView): def init_plots(self) -> None: """Initialize the plots.""" # Initialization of broadband spectrum + self._ui_form.broadbandPlot.canvas.ax.clear() self._ui_form.broadbandPlot.canvas.ax.set_xlim([0, 250]) self.set_broadband_labels() # Initialization of last measurement time domain + self._ui_form.time_domainPlot.canvas.ax.clear() self._ui_form.time_domainPlot.canvas.ax.set_xlim([0, 250]) self.set_timedomain_labels() # Initialization of last measurement frequency domain + self._ui_form.frequency_domainPlot.canvas.ax.clear() self._ui_form.frequency_domainPlot.canvas.ax.set_xlim([0, 250]) self.set_frequencydomain_labels()