Skip to content

Commit

Permalink
Merge from 5.x: PR #20221
Browse files Browse the repository at this point in the history
Fixes #20144
Fixes #20101
  • Loading branch information
ccordoba12 committed Dec 28, 2022
2 parents ec93395 + 9434669 commit 0508ee4
Show file tree
Hide file tree
Showing 15 changed files with 497 additions and 176 deletions.
2 changes: 1 addition & 1 deletion runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# NOTE: This needs to be imported before any QApplication.
# Don't remove it or change it to a different location!
# pylint: disable=wrong-import-position
from qtpy import QtWebEngineWidgets # pylint: disable=unused-import
from qtpy import QtWebEngineWidgets # noqa
import pytest


Expand Down
2 changes: 1 addition & 1 deletion spyder/api/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

"""Spyder API Version."""

VERSION_INFO = (0, 8, 0)
VERSION_INFO = (0, 9, 0)
__version__ = '.'.join(map(str, VERSION_INFO))
11 changes: 11 additions & 0 deletions spyder/api/plugins/new_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,17 @@ class SpyderPluginV2(QObject, SpyderActionMixin, SpyderConfigurationObserver,
Unmaximize plugin only if it is not `plugin_instance`.
"""

sig_mainwindow_state_changed = Signal(object)
"""
This signal is emitted when the main window state has changed (for
instance, between maximized and minimized states).
Parameters
----------
window_state: Qt.WindowStates
The window state.
"""

# --- Private attributes -------------------------------------------------
# ------------------------------------------------------------------------
# Define configuration name map for plugin to split configuration
Expand Down
2 changes: 1 addition & 1 deletion spyder/api/widgets/auxiliary_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"""

# Third party imports
from qtpy.QtCore import QEvent, Qt, QSize, Signal
from qtpy.QtCore import QEvent, QSize, Signal
from qtpy.QtWidgets import QMainWindow, QSizePolicy, QToolBar, QWidget

# Local imports
Expand Down
13 changes: 13 additions & 0 deletions spyder/app/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@ class MainWindow(QMainWindow, SpyderConfigurationAccessor):
sig_moved = Signal("QMoveEvent")
sig_layout_setup_ready = Signal(object) # Related to default layouts

sig_window_state_changed = Signal(object)
"""
This signal is emitted when the window state has changed (for instance,
between maximized and minimized states).
Parameters
----------
window_state: Qt.WindowStates
The window state.
"""

def __init__(self, splash=None, options=None):
QMainWindow.__init__(self)
qapp = QApplication.instance()
Expand Down Expand Up @@ -416,6 +427,8 @@ def register_plugin(self, plugin_name, external=False, omit_conf=False):
# Connect Main window Signals to plugin signals
self.sig_moved.connect(plugin.sig_mainwindow_moved)
self.sig_resized.connect(plugin.sig_mainwindow_resized)
self.sig_window_state_changed.connect(
plugin.sig_mainwindow_state_changed)

# Register plugin
plugin._register(omit_conf=omit_conf)
Expand Down
Loading

0 comments on commit 0508ee4

Please sign in to comment.