diff --git a/spyder/utils/icon_manager.py b/spyder/utils/icon_manager.py index ab3fc989d6a..ba7b2b316bd 100644 --- a/spyder/utils/icon_manager.py +++ b/spyder/utils/icon_manager.py @@ -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}], diff --git a/spyder/widgets/collectionseditor.py b/spyder/widgets/collectionseditor.py index 371f3790097..461e20468ef 100644 --- a/spyder/widgets/collectionseditor.py +++ b/spyder/widgets/collectionseditor.py @@ -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'), @@ -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): @@ -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() @@ -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: