diff --git a/spyderlib/plugins/history.py b/spyderlib/plugins/history.py index 800d5c32037..2e9349062fb 100644 --- a/spyderlib/plugins/history.py +++ b/spyderlib/plugins/history.py @@ -13,8 +13,8 @@ # Third party imports from qtpy import PYQT5 from qtpy.QtCore import Signal, Slot -from qtpy.QtWidgets import (QFontDialog, QGroupBox, QHBoxLayout, QInputDialog, - QMenu, QToolButton, QVBoxLayout, QWidget) +from qtpy.QtWidgets import (QGroupBox, QHBoxLayout, QInputDialog, QMenu, + QToolButton, QVBoxLayout, QWidget) # Local imports @@ -78,7 +78,6 @@ def __init__(self, parent): self.editors = [] self.filenames = [] - self.icons = [] if PYQT5: SpyderPluginWidget.__init__(self, parent, main = parent) else: @@ -203,11 +202,9 @@ def move_tab(self, index_from, index_to): """ filename = self.filenames.pop(index_from) editor = self.editors.pop(index_from) - icon = self.icons.pop(index_from) self.filenames.insert(index_to, filename) self.editors.insert(index_to, editor) - self.icons.insert(index_to, icon) #------ Public API --------------------------------------------------------- def add_history(self, filename): @@ -221,10 +218,8 @@ def add_history(self, filename): editor = codeeditor.CodeEditor(self) if osp.splitext(filename)[1] == '.py': language = 'py' - icon = ima.icon('python') else: language = 'bat' - icon = ima.icon('cmdprompt') editor.setup_editor(linenumbers=False, language=language, scrollflagarea=False) editor.focus_changed.connect(lambda: self.focus_changed.emit()) @@ -239,11 +234,9 @@ def add_history(self, filename): self.editors.append(editor) self.filenames.append(filename) - self.icons.append(icon) index = self.tabwidget.addTab(editor, osp.basename(filename)) self.find_widget.set_editor(editor) self.tabwidget.setTabToolTip(index, filename) - self.tabwidget.setTabIcon(index, icon) self.tabwidget.setCurrentIndex(index) def append_to_history(self, filename, command): diff --git a/spyderlib/plugins/ipythonconsole.py b/spyderlib/plugins/ipythonconsole.py index 88cc8c57719..c9b193ce5a1 100644 --- a/spyderlib/plugins/ipythonconsole.py +++ b/spyderlib/plugins/ipythonconsole.py @@ -1160,8 +1160,7 @@ def get_shellwidget_by_kernelwidget_id(self, kernel_id): def add_tab(self, widget, name): """Add tab""" self.clients.append(widget) - index = self.tabwidget.addTab(widget, ima.icon('ipython_console'), - name) + index = self.tabwidget.addTab(widget, name) self.tabwidget.setCurrentIndex(index) if self.dockwidget and not self.ismaximized: self.dockwidget.setVisible(True) diff --git a/spyderlib/widgets/editor.py b/spyderlib/widgets/editor.py index 0f5156eb475..bbdd0661705 100644 --- a/spyderlib/widgets/editor.py +++ b/spyderlib/widgets/editor.py @@ -32,14 +32,12 @@ from spyderlib.config.gui import (config_shortcut, fixed_shortcut, RUN_CELL_SHORTCUT, RUN_CELL_AND_ADVANCE_SHORTCUT) -from spyderlib.config.utils import get_edit_extensions from spyderlib.py3compat import qbytearray_to_str, to_text_string, u from spyderlib.utils import icon_manager as ima from spyderlib.utils import (codeanalysis, encoding, sourcecode, syntaxhighlighters) from spyderlib.utils.qthelpers import (add_actions, create_action, - create_toolbutton, get_filetype_icon, - mimedata2url) + create_toolbutton, mimedata2url) from spyderlib.widgets.editortools import OutlineExplorerWidget from spyderlib.widgets.fileswitcher import FileSwitcher from spyderlib.widgets.findreplace import FindReplace @@ -978,8 +976,7 @@ def add_to_data(self, finfo, set_current): self.data.sort(key=self.__get_sorting_func()) index = self.data.index(finfo) fname, editor = finfo.filename, finfo.editor - self.tabs.insertTab(index, editor, get_filetype_icon(fname), - self.get_tab_text(fname)) + self.tabs.insertTab(index, editor, self.get_tab_text(fname)) self.set_stack_title(index, False) if set_current: self.set_stack_index(index) @@ -991,14 +988,13 @@ def __repopulate_stack(self): self.tabs.blockSignals(True) self.tabs.clear() for finfo in self.data: - icon = get_filetype_icon(finfo.filename) if finfo.newly_created: is_modified = True else: is_modified = None tab_text = self.get_tab_text(finfo.filename, is_modified) tab_tip = self.get_tab_tip(finfo.filename) - index = self.tabs.addTab(finfo.editor, icon, tab_text) + index = self.tabs.addTab(finfo.editor, tab_text) self.tabs.setTabToolTip(index, tab_tip) self.tabs.blockSignals(False) self.update_fileswitcher_dlg() diff --git a/spyderlib/widgets/tabs.py b/spyderlib/widgets/tabs.py index e664ffde0d9..fed2206cee9 100644 --- a/spyderlib/widgets/tabs.py +++ b/spyderlib/widgets/tabs.py @@ -151,7 +151,7 @@ def __init__(self, parent, actions=None, menu=None, corner_widgets[Qt.TopLeftCorner] += [self.browse_button] self.set_corner_widgets(corner_widgets) - + def update_browse_tabs_menu(self): """Update browse tabs menu""" self.browse_tabs_menu.clear() @@ -178,7 +178,7 @@ def update_browse_tabs_menu(self): if offset <= 3: # Common path is not a path but a drive letter... offset = None - + for index, text in enumerate(names): tab_action = create_action(self, text[offset:], icon=self.tabIcon(index), @@ -187,7 +187,7 @@ def update_browse_tabs_menu(self): tip=self.tabToolTip(index)) tab_action.setChecked(index == self.currentIndex()) self.browse_tabs_menu.addAction(tab_action) - + def set_corner_widgets(self, corner_widgets): """ Set tabs corner widgets