Simplify setting the size for background tabs
We can simply look at the size of the existing open tab.
This commit is contained in:
parent
3756d9d76b
commit
a26fc89f49
@ -449,13 +449,7 @@ class TabbedBrowser(tabwidget.TabWidget):
|
|||||||
# Make sure the background tab has the correct initial size.
|
# Make sure the background tab has the correct initial size.
|
||||||
# With a foreground tab, it's going to be resized correctly by the
|
# With a foreground tab, it's going to be resized correctly by the
|
||||||
# layout anyways.
|
# layout anyways.
|
||||||
if self.tabBar().vertical:
|
tab.resize(self.currentWidget().size())
|
||||||
tab_size = QSize(self.width() - self.tabBar().width(),
|
|
||||||
self.height())
|
|
||||||
else:
|
|
||||||
tab_size = QSize(self.width(),
|
|
||||||
self.height() - self.tabBar().height())
|
|
||||||
tab.resize(tab_size)
|
|
||||||
self.tab_index_changed.emit(self.currentIndex(), self.count())
|
self.tab_index_changed.emit(self.currentIndex(), self.count())
|
||||||
else:
|
else:
|
||||||
self.setCurrentWidget(tab)
|
self.setCurrentWidget(tab)
|
||||||
|
Loading…
Reference in New Issue
Block a user