Skip to content

Commit

Permalink
Use higher-level function for creating icons
Browse files Browse the repository at this point in the history
Replace icon_manager.icon() by SpyderWidgetMixin.create_icon()

Co-authored-by: Carlos Cordoba <[email protected]>
  • Loading branch information
jitseniesen and ccordoba12 committed Sep 25, 2023
1 parent d1d765e commit 62a48dd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spyder/plugins/variableexplorer/widgets/arrayeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,21 +782,21 @@ def setup_and_check(self, data, title='', readonly=False,
self.copy_action = self.create_action(
ArrayEditorActions.Copy,
text=_('Copy'),
icon=ima.icon('editcopy'),
icon=self.create_icon('editcopy'),
triggered=self.arraywidget.view.copy)
toolbar.add_item(self.copy_action)

self.edit_action = self.create_action(
ArrayEditorActions.Edit,
text=_('Edit'),
icon=ima.icon('edit'),
icon=self.create_icon('edit'),
triggered=self.arraywidget.view.edit_item)
toolbar.add_item(self.edit_action)

self.format_action = self.create_action(
ArrayEditorActions.Format,
text=_('Format'),
icon=ima.icon('format_float'),
icon=self.create_icon('format_float'),
tip=_('Set format of floating-point numbers'),
triggered=self.arraywidget.change_format)
self.format_action.setEnabled(is_float(self.arraywidget.data.dtype))
Expand All @@ -805,15 +805,15 @@ def setup_and_check(self, data, title='', readonly=False,
self.resize_action = self.create_action(
ArrayEditorActions.Resize,
text=_('Resize'),
icon=ima.icon('collapse_column'),
icon=self.create_icon('collapse_column'),
tip=_('Resize columns to contents'),
triggered=self.arraywidget.view.resize_to_contents)
toolbar.add_item(self.resize_action)

self.toggle_bgcolor_action = self.create_action(
ArrayEditorActions.ToggleBackgroundColor,
text=_('Background color'),
icon=ima.icon('background_color'),
icon=self.create_icon('background_color'),
toggled=lambda state: self.arraywidget.model.bgcolor(state),
initial=self.arraywidget.model.bgcolor_enabled)
self.toggle_bgcolor_action.setEnabled(
Expand Down

0 comments on commit 62a48dd

Please sign in to comment.