Skip to content

Commit

Permalink
added icons for collapse columns and rows
Browse files Browse the repository at this point in the history
  • Loading branch information
dpturibio committed Apr 13, 2022
1 parent b576c12 commit 8e6dbe4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions spyder/utils/icon_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ def __init__(self):
'rename': [('mdi.rename-box',), {'color': self.MAIN_FG_COLOR}],
'move': [('mdi.file-move',), {'color': self.MAIN_FG_COLOR}],
'edit_add': [('mdi.plus',), {'color': self.MAIN_FG_COLOR}],
'collapcol': [('mdi.arrow-collapse-horizontal',), {'color': self.MAIN_FG_COLOR}],
'collaprow': [('mdi.arrow-collapse-vertical',), {'color': self.MAIN_FG_COLOR}],
'edit_remove': [('mdi.minus',), {'color': self.MAIN_FG_COLOR}],
'browse_tab': [('mdi.tab',), {'color': self.MAIN_FG_COLOR}],
'filelist': [('mdi.view-list',), {'color': self.MAIN_FG_COLOR}],
Expand Down
8 changes: 5 additions & 3 deletions spyder/widgets/collectionseditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,12 @@ def setup_table(self):
def setup_menu(self):
"""Setup context menu"""
resize_action = create_action(self, _("Resize rows to contents"),
icon=ima.icon('collaprow'),
triggered=self.resizeRowsToContents)
resize_columns_action = create_action(
self,
_("Resize columns to contents"),
icon=ima.icon('collapcol'),
triggered=self.resize_column_contents)
self.paste_action = create_action(self, _("Paste"),
icon=ima.icon('editpaste'),
Expand Down Expand Up @@ -1185,7 +1187,7 @@ def __init__(self, parent, data, readonly=False, title="",
self.setModel(self.source_model)
self.delegate = CollectionsDelegate(self)
self.setItemDelegate(self.delegate)

self.setup_table()
self.menu = self.setup_menu()
if isinstance(data, set):
Expand Down Expand Up @@ -1320,7 +1322,7 @@ def __init__(self, parent, data, readonly=False, title="", remote=False):
for item in self.editor.menu_actions:
if item is not None:
toolbar.addAction(item)

# Update the toolbar actions state
self.editor.refresh_menu()
layout = QVBoxLayout()
Expand Down Expand Up @@ -1496,7 +1498,7 @@ def __init__(self, parent, data, shellwidget=None, remote_editing=False,
self.sig_editor_creation_started)
self.delegate.sig_editor_shown.connect(self.sig_editor_shown)
self.setItemDelegate(self.delegate)

self.setup_table()

if create_menu:
Expand Down

0 comments on commit 8e6dbe4

Please sign in to comment.