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

[WiP] PR: Add a menu entry to select between available color schemes #8426

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions spyder/plugins/editor/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,17 @@ def get_plugin_actions(self):
_("Remove trailing spaces"),
triggered=self.remove_trailing_spaces)

darkscheme_action = create_action(self,
_("Change scheme to dark mode"),
tip=_("Set editor scheme to "
"'Spyder Dark'"),
triggered=self.change_scheme_todark)

whitescheme_action = create_action(self,
_("Change scheme to white mode"),
tip=_("Set editor scheme to 'Spyder'"),
triggered=self.change_scheme_towhite)

# Checkable actions
showblanks_action = self._create_checkable_action(
_("Show blank spaces"), 'blank_spaces', 'set_blanks_enabled')
Expand Down Expand Up @@ -1231,6 +1242,8 @@ def get_plugin_actions(self):
show_classfunc_dropdown_action,
showcode_analysis_pep8_action,
trailingspaces_action,
darkscheme_action,
whitescheme_action,
fixindentation_action,
MENU_SEPARATOR,
self.todo_list_action,
Expand Down Expand Up @@ -2417,6 +2430,18 @@ def fix_indentation(self):
editorstack = self.get_current_editorstack()
editorstack.fix_indentation()

@Slot()
def change_scheme_todark(self):
"Changes current editors to 'Spyder Dark' scheme"
for editorstack in self.editorstacks:
editorstack.set_color_scheme('spyder/dark')

@Slot()
def change_scheme_towhite(self):
"Changes current editors to 'Spyder' scheme"
for editorstack in self.editorstacks:
editorstack.set_color_scheme('spyder')

#------ Cursor position history management
def update_cursorpos_actions(self):
self.previous_edit_cursor_action.setEnabled(
Expand Down