8 import helldon as hildon
11 # See the Fremantle Master Layout Guide for more information:
12 # http://tinyurl.com/fremantle-master-layout-guide
14 logical_font_names = (
17 'SmallSystemFont', # Used for secondary text in buttons/TreeViews
19 'LargeSystemFont', # Used for empty TreeView text
22 'XXX-LargeSystemFont',
26 logical_color_names = (
28 'ButtonTextPressedColor',
29 'ButtonTextDisabledColor',
30 'ActiveTextColor', # Used for Button values, etc..
31 'SecondaryTextColor', # Used for additional/secondary information
34 def get_font_desc(logicalfontname):
35 settings = gtk.settings_get_default()
36 font_style = gtk.rc_get_style_by_paths(settings, logicalfontname, \
39 font_style = gtk.rc_get_style_by_paths(settings,
40 'GtkButton', 'GtkButton', gtk.Button)
42 font_desc = font_style.font_desc
45 def get_color(logicalcolorname):
46 settings = gtk.settings_get_default()
47 color_style = gtk.rc_get_style_by_paths(settings, 'GtkButton', \
48 'osso-logical-colors', gtk.Button)
51 font_style = gtk.rc_get_style_by_paths(settings,
52 'GtkButton', 'GtkButton', gtk.Button)
53 return color_style.lookup_color(logicalcolorname)
60 return get_font_desc(name).to_string()
67 return get_color(name).to_string()
70 current_module = sys.modules[__name__]
72 def mk_font_fun(name):
77 for fnt in logical_font_names:
78 setattr(current_module, fnt.replace('-', ''), mk_font_fun(fnt))
80 for clr in logical_color_names:
81 setattr(current_module, clr, lambda: color(clr))