From 796034a8ab45c82e1876d4e5c52b5863b59a8beb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 13 Nov 2021 07:18:03 +0530 Subject: [PATCH] Comments editor: Use a single line for all three toolbars if they fit --- src/calibre/gui2/comments_editor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/comments_editor.py b/src/calibre/gui2/comments_editor.py index 45e5c4addf..8546bc6c0a 100644 --- a/src/calibre/gui2/comments_editor.py +++ b/src/calibre/gui2/comments_editor.py @@ -27,7 +27,7 @@ from calibre.gui2 import ( ) from calibre.gui2.book_details import css from calibre.gui2.widgets import LineEditECM -from calibre.gui2.widgets2 import to_plain_text +from calibre.gui2.widgets2 import to_plain_text, FlowLayout from calibre.utils.cleantext import clean_xml_chars from calibre.utils.config import tweaks from calibre.utils.imghdr import what @@ -1092,9 +1092,10 @@ class Editor(QWidget): # {{{ l.setContentsMargins(0, 0, 0, 0) if one_line_toolbar: tb = QHBoxLayout() - l.addLayout(tb) else: - tb = l + tb = FlowLayout() + tb.setContentsMargins(0, 0, 0, 0) + l.addLayout(tb) tb.addWidget(self.toolbar1) tb.addWidget(self.toolbar2) tb.addWidget(self.toolbar3)