psa: remove old event feed items
[feedingit] / src / style.py
1 # -*- coding: utf-8 -*-
2 #
3 # gPodder - A media aggregator and podcast client
4 # Copyright (c) 2005-2010 Thomas Perl and the gPodder Team
5 #
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.
10 #
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.
15 #
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/>.
18 #
19
20
21 import gtk
22
23 # See the Fremantle Master Layout Guide for more information:
24 # http://tinyurl.com/fremantle-master-layout-guide
25
26 # For implementation details, consult hildon/hildon-helper.c
27 # (the function is called hildon_change_style_recursive_from_list)
28
29 logical_font_names = (
30         'SystemFont',
31         'EmpSystemFont',
32         'SmallSystemFont', # Used for secondary text in buttons/TreeViews
33         'EmpSmallSystemFont',
34         'LargeSystemFont', # Used for empty TreeView text
35         'X-LargeSystemFont',
36         'XX-LargeSystemFont',
37         'XXX-LargeSystemFont',
38         'HomeSystemFont',
39 )
40
41 logical_color_names = (
42         'ButtonTextColor',
43         'ButtonTextPressedColor',
44         'ButtonTextDisabledColor',
45         'ActiveTextColor', # Used for Button values, etc..
46         'SecondaryTextColor', # Used for additional/secondary information
47 )
48
49 def get_font_desc(logicalfontname):
50     settings = gtk.settings_get_default()
51     font_style = gtk.rc_get_style_by_paths(settings, logicalfontname, \
52             None, None)
53     font_desc = font_style.font_desc
54     return font_desc
55
56 def get_color(logicalcolorname):
57     settings = gtk.settings_get_default()
58     color_style = gtk.rc_get_style_by_paths(settings, 'GtkButton', \
59             'osso-logical-colors', gtk.Button)
60     return color_style.lookup_color(logicalcolorname)
61
62
63 # For debugging; usage: python -m gpodder.gtkui.frmntl.style
64 if __name__ == '__main__':
65     for font_name in logical_font_names:
66         print font_name, '-> ', get_font_desc(font_name).to_string()
67     print '-----------'
68     for color_name in logical_color_names:
69         print color_name, '-> ', get_color(color_name).to_string()
70