From bd463afc81ce2163fc54803b90c8313451802f56 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 27 Jul 2017 14:43:06 +0530 Subject: [PATCH] Edit book: Hide editor toolbars if theya re empty. Fixes #1706343 [Ebook editor always shows editing toolbars even when they're empty](https://bugs.launchpad.net/calibre/+bug/1706343) --- src/calibre/gui2/tweak_book/editor/widget.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/gui2/tweak_book/editor/widget.py b/src/calibre/gui2/tweak_book/editor/widget.py index 3b8e175ab2..376608d903 100644 --- a/src/calibre/gui2/tweak_book/editor/widget.py +++ b/src/calibre/gui2/tweak_book/editor/widget.py @@ -356,6 +356,8 @@ class Editor(QMainWindow): state = tprefs.get('%s-editor-state' % self.syntax, None) if state is not None: self.restoreState(state) + for bar in self.bars: + bar.setVisible(len(bar.actions()) > 0) def populate_toolbars(self): self.action_bar.clear(), self.tools_bar.clear()