Merge branch 'sebastian-frysztak-master'
This commit is contained in:
commit
69889f6bba
@ -195,6 +195,7 @@ Contributors, sorted by the number of commits in descending order:
|
|||||||
* rikn00
|
* rikn00
|
||||||
* kanikaa1234
|
* kanikaa1234
|
||||||
* haitaka
|
* haitaka
|
||||||
|
* Sebastian Frysztak
|
||||||
* Nick Ginther
|
* Nick Ginther
|
||||||
* Michał Góral
|
* Michał Góral
|
||||||
* Michael Ilsaas
|
* Michael Ilsaas
|
||||||
|
@ -703,12 +703,9 @@ class TabBarStyle(QCommonStyle):
|
|||||||
text_rect.adjust(indicator_width + indicator_padding.left +
|
text_rect.adjust(indicator_width + indicator_padding.left +
|
||||||
indicator_padding.right, 0, 0, 0)
|
indicator_padding.right, 0, 0, 0)
|
||||||
|
|
||||||
if opt.icon.isNull():
|
|
||||||
icon_rect = QRect()
|
|
||||||
else:
|
|
||||||
icon_padding = self.pixelMetric(PixelMetrics.icon_padding, opt)
|
|
||||||
icon_rect = self._get_icon_rect(opt, text_rect)
|
icon_rect = self._get_icon_rect(opt, text_rect)
|
||||||
if icon_rect.isValid():
|
if icon_rect.isValid():
|
||||||
|
icon_padding = self.pixelMetric(PixelMetrics.icon_padding, opt)
|
||||||
text_rect.adjust(icon_rect.width() + icon_padding, 0, 0, 0)
|
text_rect.adjust(icon_rect.width() + icon_padding, 0, 0, 0)
|
||||||
|
|
||||||
text_rect = self._style.visualRect(opt.direction, opt.rect, text_rect)
|
text_rect = self._style.visualRect(opt.direction, opt.rect, text_rect)
|
||||||
@ -733,9 +730,17 @@ class TabBarStyle(QCommonStyle):
|
|||||||
else QIcon.Disabled)
|
else QIcon.Disabled)
|
||||||
icon_state = (QIcon.On if opt.state & QStyle.State_Selected
|
icon_state = (QIcon.On if opt.state & QStyle.State_Selected
|
||||||
else QIcon.Off)
|
else QIcon.Off)
|
||||||
tab_icon_size = opt.icon.actualSize(icon_size, icon_mode, icon_state)
|
# reserve space for favicon when tab bar is vertical (issue #1968)
|
||||||
tab_icon_size = QSize(min(tab_icon_size.width(), icon_size.width()),
|
position = config.get('tabs', 'position')
|
||||||
min(tab_icon_size.height(), icon_size.height()))
|
if (opt.icon.isNull() and
|
||||||
|
position in [QTabWidget.East, QTabWidget.West] and
|
||||||
|
config.get('tabs', 'show-favicons')):
|
||||||
|
tab_icon_size = icon_size
|
||||||
|
else:
|
||||||
|
actual_size = opt.icon.actualSize(icon_size, icon_mode, icon_state)
|
||||||
|
tab_icon_size = QSize(
|
||||||
|
min(actual_size.width(), icon_size.width()),
|
||||||
|
min(actual_size.height(), icon_size.height()))
|
||||||
icon_rect = QRect(text_rect.left(), text_rect.top() + 1,
|
icon_rect = QRect(text_rect.left(), text_rect.top() + 1,
|
||||||
tab_icon_size.width(), tab_icon_size.height())
|
tab_icon_size.width(), tab_icon_size.height())
|
||||||
icon_rect = self._style.visualRect(opt.direction, opt.rect, icon_rect)
|
icon_rect = self._style.visualRect(opt.direction, opt.rect, icon_rect)
|
||||||
|
@ -41,6 +41,7 @@ class TestTabWidget:
|
|||||||
'position': 0,
|
'position': 0,
|
||||||
'select-on-remove': 1,
|
'select-on-remove': 1,
|
||||||
'show': 'always',
|
'show': 'always',
|
||||||
|
'show-favicons': True,
|
||||||
'padding': configtypes.PaddingValues(0, 0, 5, 5),
|
'padding': configtypes.PaddingValues(0, 0, 5, 5),
|
||||||
'indicator-width': 3,
|
'indicator-width': 3,
|
||||||
'indicator-padding': configtypes.PaddingValues(2, 2, 0, 4),
|
'indicator-padding': configtypes.PaddingValues(2, 2, 0, 4),
|
||||||
|
Loading…
Reference in New Issue
Block a user