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)

This commit is contained in:
Kovid Goyal 2018-05-31 08:20:15 +05:30
parent 4a77d32a0e
commit b1101b7693
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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):