removes leftover space in tab bar when the window width is not divisible by the number of tabs
This commit is contained in:
parent
739d2cfffd
commit
de5308cbbf
@ -407,7 +407,12 @@ class TabBar(QTabBar):
|
|||||||
else:
|
else:
|
||||||
# If we *do* have enough space, tabs should occupy the whole window
|
# If we *do* have enough space, tabs should occupy the whole window
|
||||||
# width.
|
# width.
|
||||||
size = QSize(self.width() / self.count(), height)
|
width = self.width() / self.count()
|
||||||
|
# If width is not divisible by count, add a pixel to some tabs so
|
||||||
|
# that there is no ugly leftover space.
|
||||||
|
if index < self.width() % self.count():
|
||||||
|
width += 1
|
||||||
|
size = QSize(width, height)
|
||||||
qtutils.ensure_valid(size)
|
qtutils.ensure_valid(size)
|
||||||
return size
|
return size
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user