X-Git-Url: http://git.maemo.org/git/?p=jamaendo;a=blobdiff_plain;f=jamaui%2Fcolors.py;h=391d18a8c3e65d8fcbfbccf0d15f0deece192ccb;hp=c17dbc9402fa1d3f3be6ff720e8d8afc2c8b93f4;hb=61536ca548691b15e7f63340a0fbfb5a3055d5be;hpb=f83270c7ae6fde54870169438a1ec1988758d329 diff --git a/jamaui/colors.py b/jamaui/colors.py index c17dbc9..391d18a 100644 --- a/jamaui/colors.py +++ b/jamaui/colors.py @@ -1,7 +1,12 @@ # hildon colors import gtk -import hildon +try: + import hildon + _using_helldon = False +except: + import helldon as hildon + _using_helldon = True # See the Fremantle Master Layout Guide for more information: # http://tinyurl.com/fremantle-master-layout-guide @@ -30,6 +35,10 @@ def get_font_desc(logicalfontname): settings = gtk.settings_get_default() font_style = gtk.rc_get_style_by_paths(settings, logicalfontname, \ None, None) + if not font_style: + font_style = gtk.rc_get_style_by_paths(settings, + 'GtkButton', 'GtkButton', gtk.Button) + font_desc = font_style.font_desc return font_desc @@ -37,20 +46,31 @@ def get_color(logicalcolorname): settings = gtk.settings_get_default() color_style = gtk.rc_get_style_by_paths(settings, 'GtkButton', \ 'osso-logical-colors', gtk.Button) - return color_style.lookup_color(logicalcolorname) -def font(name): - return get_font_desc(name).to_string() + if not color_style: + font_style = gtk.rc_get_style_by_paths(settings, + 'GtkButton', 'GtkButton', gtk.Button) + return color_style.lookup_color(logicalcolorname) +if _using_helldon: + def font(name): + return "normal" +else: + def font(name): + return get_font_desc(name).to_string() -def color(name): - return get_color('SecondaryTextColor').to_string() +if _using_helldon: + def color(name): + return "#333333" +else: + def color(name): + return get_color('SecondaryTextColor').to_string() import sys current_module = sys.modules[__name__] for fnt in logical_font_names: - setattr(current_module, fnt, font(fnt)) + setattr(current_module, fnt, lambda: font(fnt)) for clr in logical_color_names: - setattr(current_module, clr, color(clr)) + setattr(current_module, clr, lambda: color(clr))