From 0a6d1b4b4ab8e3b91066951acf1fe801fb8fe6f9 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Wed, 19 Oct 2022 15:00:59 +0100 Subject: [PATCH] Sorry, I forgot the separator. --- src/calibre/gui2/bars.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/bars.py b/src/calibre/gui2/bars.py index c3187be1c8..8eb3accd6a 100644 --- a/src/calibre/gui2/bars.py +++ b/src/calibre/gui2/bars.py @@ -9,7 +9,7 @@ from functools import partial from qt.core import ( Qt, QAction, QMenu, QObject, QToolBar, QToolButton, QSize, pyqtSignal, QKeySequence, QMenuBar, QTimer, QPropertyAnimation, QEasingCurve, pyqtProperty, QPainter, QWidget, QPalette, sip, - QHBoxLayout) + QHBoxLayout, QFrame) from calibre.constants import ismacos from calibre.gui2 import gprefs, native_menubar_defaults, config @@ -679,11 +679,23 @@ class BarsManager(QObject): for ac in self.search_tool_bar_actions: self.search_tool_bar.removeWidget(ac) + self.search_tool_bar.setContentsMargins(0, 0, 0, 0) + self.search_tool_bar.setSpacing(0) + self.search_tool_bar_actions = [] for what in gprefs['action-layout-searchbar']: - if what in self.parent().iactions: + if what is None: + frame = QFrame() + frame.setFrameShape(QFrame.Shape.VLine) + frame.setFrameShadow(QFrame.Shadow.Sunken) + frame.setLineWidth(1) + frame.setContentsMargins(0, 5, 0, 5) + self.search_tool_bar.addWidget(frame) + self.search_tool_bar_actions.append(frame) + elif what in self.parent().iactions: qact = self.parent().iactions[what].qaction tb = QToolButton() + tb.setContentsMargins(0, 0, 0, 0) tb.setDefaultAction(qact) if not gprefs['search_tool_bar_shows_text']: tb.setText(None)