From 77115eaa59304c421f15b9ca85420f2350b30fe7 Mon Sep 17 00:00:00 2001 From: Rafael Laverde Date: Mon, 4 Sep 2017 16:10:48 -0500 Subject: [PATCH] Start/stop find in files waiting spinner when is shown/hidden. --- spyder/widgets/findinfiles.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spyder/widgets/findinfiles.py b/spyder/widgets/findinfiles.py index 4e2b1054237..6acd861739a 100644 --- a/spyder/widgets/findinfiles.py +++ b/spyder/widgets/findinfiles.py @@ -781,7 +781,6 @@ def __init__(self, parent): self.spinner = QWaitingSpinner(self, centerOnParent=False) self.spinner.setNumberOfLines(12) self.spinner.setInnerRadius(2) - self.spinner.start() layout = QHBoxLayout() layout.addWidget(self.spinner) layout.addWidget(self.status_text) @@ -799,6 +798,16 @@ def set_label_path(self, path, folder=False): def reset(self): self.status_text.setText(_(" Searching for files...")) + def showEvent(self, event): + """Override show event to start waiting spinner.""" + QWidget.showEvent(self, event) + self.spinner.start() + + def hideEvent(self, event): + """Override hide event to stop waiting spinner.""" + QWidget.hideEvent(self, event) + self.spinner.stop() + class FindInFilesWidget(QWidget): """