Make it easier to disable tab indicator

This commit is contained in:
Florian Bruhin 2014-07-17 14:50:16 +02:00
parent 55d257cecd
commit 34d1449cd2
2 changed files with 5 additions and 3 deletions

View File

@ -435,7 +435,7 @@ DATA = OrderedDict([
('indicator-width', ('indicator-width',
SettingValue(types.Int(minval=0), '3'), SettingValue(types.Int(minval=0), '3'),
"Width of the progress indicator."), "Width of the progress indicator (0 to disable)."),
('indicator-space', ('indicator-space',
SettingValue(types.Int(minval=0), '3'), SettingValue(types.Int(minval=0), '3'),

View File

@ -385,9 +385,11 @@ class TabBarStyle(QCommonStyle):
icon_rect = QRect() icon_rect = QRect()
text_rect = QRect(opt.rect) text_rect = QRect(opt.rect)
qt_ensure_valid(text_rect) qt_ensure_valid(text_rect)
indicator_width = config.get('tabbar', 'indicator-width')
text_rect.adjust(padding, 0, 0, 0) text_rect.adjust(padding, 0, 0, 0)
text_rect.adjust(config.get('tabbar', 'indicator-width') + if indicator_width != 0:
config.get('tabbar', 'indicator-space'), 0, 0, 0) text_rect.adjust(indicator_width +
config.get('tabbar', 'indicator-space'), 0, 0, 0)
if not opt.icon.isNull(): if not opt.icon.isNull():
icon_rect = self._get_icon_rect(opt, text_rect) icon_rect = self._get_icon_rect(opt, text_rect)
text_rect.adjust(icon_rect.width() + padding, 0, 0, 0) text_rect.adjust(icon_rect.width() + padding, 0, 0, 0)