1132 def __aboutToShowClosedTabsMenu(self): |
1132 def __aboutToShowClosedTabsMenu(self): |
1133 """ |
1133 """ |
1134 Private slot to populate the closed tabs menu. |
1134 Private slot to populate the closed tabs menu. |
1135 """ |
1135 """ |
1136 fm = self.__closedTabsMenu.fontMetrics() |
1136 fm = self.__closedTabsMenu.fontMetrics() |
1137 maxWidth = fm.width('m') * 40 |
1137 try: |
|
1138 maxWidth = fm.horizontalAdvance('m') * 40 |
|
1139 except AttributeError: |
|
1140 maxWidth = fm.width('m') * 40 |
1138 |
1141 |
1139 self.__closedTabsMenu.clear() |
1142 self.__closedTabsMenu.clear() |
1140 index = 0 |
1143 index = 0 |
1141 for tab in self.__closedTabsManager.allClosedTabs(): |
1144 for tab in self.__closedTabsManager.allClosedTabs(): |
1142 title = fm.elidedText(tab.title, Qt.ElideRight, maxWidth) |
1145 title = fm.elidedText(tab.title, Qt.ElideRight, maxWidth) |