Make min/max tab width configurable

This commit is contained in:
Florian Bruhin 2014-05-12 16:04:43 +02:00
parent 7b2961f23e
commit c3816b2820
3 changed files with 12 additions and 3 deletions

View File

@ -299,6 +299,14 @@ DATA = OrderedDict([
('wrap',
SettingValue(types.Bool(), 'true'),
"Whether to wrap when changing tabs."),
('min-tab-width',
SettingValue(types.Int(), '100'),
"The minimum width of a tab."),
('max-tab-width',
SettingValue(types.Int(), '200'),
"The maximum width of a tab."),
)),
('webkit', sect.KeyValue(

View File

@ -45,7 +45,8 @@ def get_stylesheet(template):
_colordict = ColorDict(config.section('colors'))
if _fontdict is None:
_fontdict = FontDict(config.section('fonts'))
return template.strip().format(color=_colordict, font=_fontdict)
return template.strip().format(color=_colordict, font=_fontdict,
config=config.instance())
def set_register_stylesheet(obj):

View File

@ -49,8 +49,8 @@ class TabWidget(QTabWidget):
{color[tab.fg]}
padding: 0px 5px 0px 5px;
border-right: 2px solid {color[tab.seperator]};
min-width: 100px;
max-width: 200px;
min-width: {config[tabbar][min-tab-width]}px;
max-width: {config[tabbar][max-tab-width]}px;
}}
QTabBar::tab:selected {{