set default application font (if any) to
themes, instead of 'Sans 10'
This commit is contained in:
parent
1be0ea46f1
commit
a2cccb8d25
28
src/gajim.py
28
src/gajim.py
|
@ -33,6 +33,7 @@ except RuntimeError, msg:
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
import gobject
|
import gobject
|
||||||
|
import pango
|
||||||
import os
|
import os
|
||||||
import sre
|
import sre
|
||||||
import signal
|
import signal
|
||||||
|
@ -1048,13 +1049,28 @@ class Interface:
|
||||||
d = ['accounttextcolor', 'accountbgcolor', 'accountfont',
|
d = ['accounttextcolor', 'accountbgcolor', 'accountfont',
|
||||||
'grouptextcolor', 'groupbgcolor', 'groupfont', 'contacttextcolor',
|
'grouptextcolor', 'groupbgcolor', 'groupfont', 'contacttextcolor',
|
||||||
'contactbgcolor', 'contactfont', 'bannertextcolor', 'bannerbgcolor']
|
'contactbgcolor', 'contactfont', 'bannertextcolor', 'bannerbgcolor']
|
||||||
default = gajim.config.themes_default
|
|
||||||
for theme in default:
|
|
||||||
gajim.config.add_per('themes', theme)
|
|
||||||
for o in d:
|
|
||||||
gajim.config.set_per('themes', theme, o,
|
|
||||||
default[theme][d.index(o)])
|
|
||||||
|
|
||||||
|
font_str = gtkgui_helpers.get_default_font()
|
||||||
|
if font_str == None:
|
||||||
|
font_str = 'Sans 10'
|
||||||
|
font = pango.FontDescription(font_str)
|
||||||
|
font_normal = font.to_string()
|
||||||
|
font.set_style(pango.STYLE_ITALIC)
|
||||||
|
font_italic = font.to_string()
|
||||||
|
font.set_style(pango.STYLE_NORMAL)
|
||||||
|
font.set_weight(pango.WEIGHT_BOLD)
|
||||||
|
font_bold = font.to_string()
|
||||||
|
|
||||||
|
default = gajim.config.themes_default
|
||||||
|
for theme_name in default:
|
||||||
|
gajim.config.add_per('themes', theme_name)
|
||||||
|
theme = default[theme_name]
|
||||||
|
theme[d.index('accountfont')] = font_bold
|
||||||
|
theme[d.index('groupfont')] = font_italic
|
||||||
|
theme[d.index('contactfont')] = font_normal
|
||||||
|
for o in d:
|
||||||
|
gajim.config.set_per('themes', theme_name, o,
|
||||||
|
theme[d.index(o)])
|
||||||
|
|
||||||
if gajim.config.get('autodetect_browser_mailer'):
|
if gajim.config.get('autodetect_browser_mailer'):
|
||||||
gtkgui_helpers.autodetect_browser_mailer()
|
gtkgui_helpers.autodetect_browser_mailer()
|
||||||
|
|
Loading…
Reference in New Issue