From b4fa38612b5de8be8983fd105a066ce7553c42ce Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 3 Apr 2023 10:21:20 +0530 Subject: [PATCH] Make tab appearance nicer in locked mode --- src/calibre/gui2/palette.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/palette.py b/src/calibre/gui2/palette.py index b3d40bac79..d919154eec 100644 --- a/src/calibre/gui2/palette.py +++ b/src/calibre/gui2/palette.py @@ -383,8 +383,21 @@ QTabBar::tab:selected { border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-width: 0; - padding: 2px; - padding-left: 0.5em; + padding: 2px 8px; + margin-left: -4px; + margin-right: -4px; +} + +QTabBar::tab:first:selected { + margin-left: 0; /* the first selected tab has nothing to overlap with on the left */ +} + +QTabBar::tab:last:selected { + margin-right: 0; /* the last selected tab has nothing to overlap with on the right */ +} + +QTabBar::tab:only-one { + margin: 0; /* if there is only one tab, we don't want overlapping margins */ } ''' app.setStyleSheet(ss)