Rename _minimum_tab_size_hint_helper

This commit is contained in:
Jay Kamat 2017-10-20 15:40:11 -04:00
parent f6cc9d53b8
commit e705ea7e56
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5

View File

@ -447,13 +447,14 @@ class TabBar(QTabBar):
Return:
A QSize of the smallest tab size we can make.
"""
return self.__minimumTabSizeHintHelper(self.tabText(index),
self.tabIcon(index), ellipsis)
return self._minimum_tab_size_hint_helper(self.tabText(index),
self.tabIcon(index),
ellipsis)
@functools.lru_cache(maxsize=100)
def __minimumTabSizeHintHelper(self, tab_text: str,
icon,
ellipsis: bool) -> QSize:
def _minimum_tab_size_hint_helper(self, tab_text: str,
icon,
ellipsis: bool) -> QSize:
"""Helper function to cache tab results."""
text = '\u2026' if ellipsis else tab_text
# Don't ever shorten if text is shorter than the ellipsis