add "fgcolor" conf param
This commit is contained in:
parent
546de0c965
commit
6edac86409
10
Window.py
10
Window.py
@ -17,6 +17,8 @@ class Window(object):
|
||||
self.conf['mailbox'] = 'Inbox'
|
||||
if not 'updaterate' in self.conf:
|
||||
self.conf['updaterate'] = 5000
|
||||
if not 'fgcolor' in self.conf:
|
||||
self.conf['fgcolor'] = (0.0, 0.0, 0.0)
|
||||
if not 'bgcolor' in self.conf:
|
||||
self.conf['bgcolor'] = (1.0, 0.5, 0.0)
|
||||
if not 'font_size' in self.conf:
|
||||
@ -89,9 +91,13 @@ class Window(object):
|
||||
if self.connection is None:
|
||||
self.label.set_text('-')
|
||||
else:
|
||||
fgcolor = ''.join(map(lambda x: '%02x' % int(0xFF * x),
|
||||
self.conf['fgcolor']))
|
||||
sz = 1024 * self.conf['font_size']
|
||||
self.label.set_markup(
|
||||
('<span font_weight="bold" font_size="%d">%d</span>'
|
||||
% (1024 * self.conf['font_size'], self.count)))
|
||||
('<span font_weight="bold" foreground="#%s" '
|
||||
'font_size="%d">%d</span>'
|
||||
% (fgcolor, sz, self.count)))
|
||||
|
||||
def destroy_event(self):
|
||||
self.disconnect()
|
||||
|
Loading…
x
Reference in New Issue
Block a user