From b1101b76935aca395afc4ce7693535ce0641d8f6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 31 May 2018 08:20:15 +0530 Subject: [PATCH] Fix option to show text under buttonsonly if there is enough space not working well with the option to use two lines for the text under the buttons. Fixes #1773426 [Menue icons - show text if there is enough room](https://bugs.launchpad.net/calibre/+bug/1773426) --- src/calibre/gui2/bars.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/bars.py b/src/calibre/gui2/bars.py index 1587f679ba..4acaf35b52 100644 --- a/src/calibre/gui2/bars.py +++ b/src/calibre/gui2/bars.py @@ -160,7 +160,7 @@ class ToolBar(QToolBar): # {{{ p = gprefs['toolbar_text'] if p == 'never': style = Qt.ToolButtonIconOnly - elif p == 'auto' and self.preferred_width > self.width()+35: + elif p == 'auto' and self.preferred_width > self.width()+15: style = Qt.ToolButtonIconOnly return style @@ -211,9 +211,9 @@ class ToolBar(QToolBar): # {{{ self.addAction(action.qaction) self.added_actions.append(action.qaction) self.setup_tool_button(self, action.qaction, action.popup_type) - self.preferred_width = self.sizeHint().width() if gprefs['wrap_toolbar_text']: wrap_all_button_texts(self.all_widgets) + self.preferred_width = self.sizeHint().width() self.all_widgets = [] def setup_tool_button(self, bar, ac, menu_mode=None):