Skip to content

Commit 9434669

Browse files
authored
Merge pull request #20221 from ccordoba12/editor-window-fixes
PR: Several fixes for new Editor windows
2 parents 7a00975 + 43085bb commit 9434669

File tree

15 files changed

+497
-176
lines changed

15 files changed

+497
-176
lines changed

runtests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# NOTE: This needs to be imported before any QApplication.
2121
# Don't remove it or change it to a different location!
2222
# pylint: disable=wrong-import-position
23-
from qtpy import QtWebEngineWidgets # pylint: disable=unused-import
23+
from qtpy import QtWebEngineWidgets # noqa
2424
import pytest
2525

2626

spyder/api/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
"""Spyder API Version."""
88

9-
VERSION_INFO = (0, 8, 0)
9+
VERSION_INFO = (0, 9, 0)
1010
__version__ = '.'.join(map(str, VERSION_INFO))

spyder/api/plugins/new_api.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,17 @@ class SpyderPluginV2(QObject, SpyderActionMixin, SpyderConfigurationObserver,
279279
Unmaximize plugin only if it is not `plugin_instance`.
280280
"""
281281

282+
sig_mainwindow_state_changed = Signal(object)
283+
"""
284+
This signal is emitted when the main window state has changed (for
285+
instance, between maximized and minimized states).
286+
287+
Parameters
288+
----------
289+
window_state: Qt.WindowStates
290+
The window state.
291+
"""
292+
282293
# --- Private attributes -------------------------------------------------
283294
# ------------------------------------------------------------------------
284295
# Define configuration name map for plugin to split configuration

spyder/api/widgets/auxiliary_widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"""
1010

1111
# Third party imports
12-
from qtpy.QtCore import QEvent, Qt, QSize, Signal
12+
from qtpy.QtCore import QEvent, QSize, Signal
1313
from qtpy.QtWidgets import QMainWindow, QSizePolicy, QToolBar, QWidget
1414

1515
# Local imports

spyder/app/mainwindow.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,17 @@ class MainWindow(QMainWindow, SpyderConfigurationAccessor):
145145
# To be removed in Spyder 6
146146
sig_pythonpath_changed = Signal(object, object)
147147

148+
sig_window_state_changed = Signal(object)
149+
"""
150+
This signal is emitted when the window state has changed (for instance,
151+
between maximized and minimized states).
152+
153+
Parameters
154+
----------
155+
window_state: Qt.WindowStates
156+
The window state.
157+
"""
158+
148159
def __init__(self, splash=None, options=None):
149160
QMainWindow.__init__(self)
150161
qapp = QApplication.instance()
@@ -422,6 +433,8 @@ def register_plugin(self, plugin_name, external=False, omit_conf=False):
422433
# Connect Main window Signals to plugin signals
423434
self.sig_moved.connect(plugin.sig_mainwindow_moved)
424435
self.sig_resized.connect(plugin.sig_mainwindow_resized)
436+
self.sig_window_state_changed.connect(
437+
plugin.sig_mainwindow_state_changed)
425438

426439
# Register plugin
427440
plugin._register(omit_conf=omit_conf)

0 commit comments

Comments
 (0)