Prevent minimumTabsizeHint from being called when booting on mac

Move workaround higher up to the start of tabSizeHint
This commit is contained in:
Jay Kamat 2018-03-19 18:29:51 -04:00
parent 7278b7c2e5
commit f6c00babbe
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5

View File

@ -562,6 +562,12 @@ class TabBar(QTabBar):
Return: Return:
A QSize. A QSize.
""" """
if self.count() == 0:
# This happens on startup on macOS.
# We return it directly rather than setting `size' because we don't
# want to ensure it's valid in this special case.
return QSize()
minimum_size = self.minimumTabSizeHint(index) minimum_size = self.minimumTabSizeHint(index)
height = minimum_size.height() height = minimum_size.height()
if self.vertical: if self.vertical:
@ -574,11 +580,6 @@ class TabBar(QTabBar):
else: else:
width = int(confwidth) width = int(confwidth)
size = QSize(max(minimum_size.width(), width), height) size = QSize(max(minimum_size.width(), width), height)
elif self.count() == 0:
# This happens on startup on macOS.
# We return it directly rather than setting `size' because we don't
# want to ensure it's valid in this special case.
return QSize()
else: else:
if config.val.tabs.pinned.shrink: if config.val.tabs.pinned.shrink:
pinned = self._tab_pinned(index) pinned = self._tab_pinned(index)