tiny color change
[jamaendo] / jamaui / colors.py
1 # hildon colors
2
3 import gtk
4 import hildon
5
6 # See the Fremantle Master Layout Guide for more information:
7 # http://tinyurl.com/fremantle-master-layout-guide
8
9 logical_font_names = (
10     'SystemFont',
11     'EmpSystemFont',
12     'SmallSystemFont', # Used for secondary text in buttons/TreeViews
13     'EmpSmallSystemFont',
14     'LargeSystemFont', # Used for empty TreeView text
15     'X-LargeSystemFont',
16     'XX-LargeSystemFont',
17     'XXX-LargeSystemFont',
18     'HomeSystemFont',
19 )
20
21 logical_color_names = (
22     'ButtonTextColor',
23     'ButtonTextPressedColor',
24     'ButtonTextDisabledColor',
25     'ActiveTextColor', # Used for Button values, etc..
26     'SecondaryTextColor', # Used for additional/secondary information
27 )
28
29 def get_font_desc(logicalfontname):
30     settings = gtk.settings_get_default()
31     font_style = gtk.rc_get_style_by_paths(settings, logicalfontname, \
32                                                None, None)
33     font_desc = font_style.font_desc
34     return font_desc
35
36 def get_color(logicalcolorname):
37     settings = gtk.settings_get_default()
38     color_style = gtk.rc_get_style_by_paths(settings, 'GtkButton', \
39                                                 'osso-logical-colors', gtk.Button)
40     return color_style.lookup_color(logicalcolorname)
41
42 def font(name):
43     return get_font_desc(name).to_string()
44
45
46 def color(name):
47     return get_color('SecondaryTextColor').to_string()
48
49 import sys
50 current_module = sys.modules[__name__]
51
52 for fnt in logical_font_names:
53     setattr(current_module, fnt, font(fnt))
54
55 for clr in logical_color_names:
56     setattr(current_module, clr, color(clr))