Skip to content

Commit

Permalink
IPython console: Add icons to several actions in clients' context menu
Browse files Browse the repository at this point in the history
- That matches the UI used for the same actions but in other contexts.
- Also, add transparent icons in a couple of places to make Qt render
the associated actions correctly.
  • Loading branch information
ccordoba12 committed Mar 5, 2024
1 parent 5084df7 commit ad17193
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions spyder/plugins/findinfiles/widgets/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ def setup(self):
self.set_max_results_action = self.create_action(
FindInFilesWidgetActions.MaxResults,
text=_('Set maximum number of results'),
icon=self.create_icon("transparent"),
tip=_('Set maximum number of results'),
triggered=lambda x=None: self.set_max_results(),
)
Expand Down
11 changes: 9 additions & 2 deletions spyder/plugins/ipythonconsole/widgets/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,15 @@ def setup(self):
cut_action = self.create_action(
ClientContextMenuActions.Cut,
text=_("Cut"),
icon=self.create_icon("editcut"),
triggered=self._current_client_cut
)
cut_action.setShortcut(QKeySequence.Cut)

copy_action = self.create_action(
ClientContextMenuActions.Copy,
text=_("Copy"),
icon=self.create_icon("editcopy"),
triggered=self._current_client_copy
)
copy_action.setShortcut(QKeySequence.Copy)
Expand All @@ -467,13 +469,15 @@ def setup(self):
paste_action = self.create_action(
ClientContextMenuActions.Paste,
text=_("Paste"),
icon=self.create_icon("editpaste"),
triggered=self._current_client_paste
)
paste_action.setShortcut(QKeySequence.Paste)

self.create_action(
ClientContextMenuActions.SelectAll,
text=_("Select all"),
icon=self.create_icon("selectall"),
triggered=self._current_client_select_all
)

Expand All @@ -488,6 +492,7 @@ def setup(self):
self.create_action(
ClientContextMenuActions.ArrayTable,
text=_("Enter array table"),
icon=self.create_icon("arredit"),
triggered=self._current_client_enter_array_table,
register_shortcut=True
)
Expand All @@ -501,13 +506,15 @@ def setup(self):

self.create_action(
ClientContextMenuActions.Export,
text=_("Save as html"),
text=_("Save as html..."),
icon=self.create_icon("CodeFileIcon"),
triggered=self._current_client_export
)

self.create_action(
ClientContextMenuActions.Print,
text=_("Print"),
text=_("Print..."),
icon=self.create_icon("print"),
triggered=self._current_client_print
)

Expand Down
1 change: 1 addition & 0 deletions spyder/plugins/projects/widgets/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def setup(self):
self.max_recent_action = self.create_action(
ProjectsActions.MaxRecent,
text=_("Maximum number of recent projects..."),
icon=self.create_icon("transparent"),
triggered=self.change_max_recent_projects)

self.recent_project_menu = self.create_menu(
Expand Down

0 comments on commit ad17193

Please sign in to comment.