Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Set right roles for some actions on macOS menu bar #15049

Merged
merged 1 commit into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion spyder/plugins/application/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@

# Standard library imports
import os
import sys

# Third party imports
from qtpy.QtCore import Qt, QThread, Slot
from qtpy.QtWidgets import QMessageBox
from qtpy.QtWidgets import QMessageBox, QAction

# Local imports
from spyder import (
Expand Down Expand Up @@ -114,6 +115,8 @@ def setup(self):
_("About %s...") % "Spyder",
icon=self.create_icon('MessageBoxInformation'),
triggered=self.show_about)
if sys.platform == 'darwin':
self.about_action.setMenuRole(QAction.AboutRole)

# Tools actions
if WinUserEnvDialog is not None:
Expand Down
7 changes: 7 additions & 0 deletions spyder/plugins/preferences/widgets/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)

# Standard library imports
import sys

# Third party imports
from qtpy.QtCore import Signal
from qtpy.QtWidgets import QAction

# Local imports
from spyder.api.translations import get_translation
Expand Down Expand Up @@ -104,6 +108,9 @@ def setup(self):
triggered=self.show_preferences
)

if sys.platform == 'darwin':
self.show_action.setMenuRole(QAction.PreferencesRole)

self.reset_action = self.create_action(
PreferencesActions.Reset,
_("Reset Spyder to factory defaults"),
Expand Down