Skip to content

Commit

Permalink
History: Remove extra padding in tabs because they don't have a close…
Browse files Browse the repository at this point in the history
… button
  • Loading branch information
ccordoba12 committed Apr 1, 2021
1 parent 9d8ffc3 commit 553bba9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions spyder/plugins/history/widgets.py
Expand Up @@ -25,6 +25,7 @@
from spyder.widgets.findreplace import FindReplace
from spyder.widgets.simplecodeeditor import SimpleCodeEditor
from spyder.widgets.tabs import Tabs
from spyder.utils.stylesheet import PANES_TABBAR_STYLESHEET

# Localization
_ = get_translation('spyder')
Expand Down Expand Up @@ -81,6 +82,7 @@ def __init__(self, name, plugin, parent):
self.find_widget = FindReplace(self)

# Setup
self.tabwidget.setStyleSheet(self._tabs_stylesheet)
self.find_widget.hide()

# Layout
Expand Down Expand Up @@ -304,6 +306,16 @@ def refresh(self):

self.find_widget.set_editor(editor)

@property
def _tabs_stylesheet(self):
"""
Change style of tabs because we don't have a close button here.
"""
tabs_stylesheet = PANES_TABBAR_STYLESHEET.get_copy()
css = tabs_stylesheet.get_stylesheet()
css['QTabBar::tab'].setValues(padding='4px')
return tabs_stylesheet.to_string()


def test():
"""Run history widget."""
Expand Down
2 changes: 1 addition & 1 deletion spyder/utils/stylesheet.py
Expand Up @@ -41,7 +41,7 @@ def get_copy(self):
This allows it to be modified for specific widgets.
"""
return copy.deepcopy(self._stylesheet)
return copy.deepcopy(self)

def set_stylesheet(self):
raise NotImplementedError(
Expand Down

0 comments on commit 553bba9

Please sign in to comment.