Proper startup and text styling for Fremantle
[gpodder.git] / src / gpodder / gtkui / frmntl / style.py
blob17dedb1101a8c734856169ce6a5e4adadfb83f97
1 # -*- coding: utf-8 -*-
3 # gPodder - A media aggregator and podcast client
4 # Copyright (c) 2005-2009 Thomas Perl and the gPodder Team
6 # gPodder is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # gPodder is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 import gtk
22 import hildon
24 # See the Fremantle Master Layout Guide for more information:
25 # http://tinyurl.com/fremantle-master-layout-guide
27 # For implementation details, consult hildon/hildon-helper.c
28 # (the function is called hildon_change_style_recursive_from_list)
30 logical_font_names = (
31 'SystemFont',
32 'EmpSystemFont',
33 'SmallSystemFont', # Used for secondary text in buttons/TreeViews
34 'EmpSmallSystemFont',
35 'LargeSystemFont', # Used for empty TreeView text
36 'X-LargeSystemFont',
37 'XX-LargeSystemFont',
38 'XXX-LargeSystemFont',
39 'HomeSystemFont',
42 logical_color_names = (
43 'ButtonTextColor',
44 'ButtonTextPressedColor',
45 'ButtonTextDisabledColor',
46 'ActiveTextColor', # Used for Button values, etc..
47 'SecondaryTextColor', # Used for additional/secondary information
50 def get_font_desc(logicalfontname):
51 settings = gtk.settings_get_default()
52 font_style = gtk.rc_get_style_by_paths(settings, logicalfontname, \
53 None, None)
54 font_desc = font_style.font_desc
55 return font_desc
57 def get_color(logicalcolorname):
58 settings = gtk.settings_get_default()
59 color_style = gtk.rc_get_style_by_paths(settings, 'GtkButton', \
60 'osso-logical-colors', gtk.Button)
61 return color_style.lookup_color(logicalcolorname)
64 # For debugging; usage: python -m gpodder.gtkui.frmntl.style
65 if __name__ == '__main__':
66 for font_name in logical_font_names:
67 print font_name, '-> ', get_font_desc(font_name).to_string()
68 print '-----------'
69 for color_name in logical_color_names:
70 print color_name, '-> ', get_color(color_name).to_string()