X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=jamaui%2Fsongposition.py;h=668deec5f859396831fb099fe2ae418b531318ac;hb=3f9780b2b25864881151f5d99b234587a65cf451;hp=705962c0e39b96b87e2d01962c7d47088537c11d;hpb=8c99ab80f5406ca2e51029cac035b04903aa1d5e;p=jamaendo diff --git a/jamaui/songposition.py b/jamaui/songposition.py index 705962c..668deec 100644 --- a/jamaui/songposition.py +++ b/jamaui/songposition.py @@ -6,7 +6,7 @@ log = logging.getLogger(__name__) # shows the current song position (looking a bit nicer than a default widget, hopefully) class SongPosition(gtk.DrawingArea): - WIDTH = 8.0 + WIDTH = 32.0 HEIGHT = 8.0 def __init__(self): @@ -29,9 +29,9 @@ class SongPosition(gtk.DrawingArea): darkclr.add_color_stop_rgba(1.0, 0.25, 0.25, 0.25, 1.0) markerclr = cairo.LinearGradient(0.0, 0.0, 0.0, self.HEIGHT) - markerclr.add_color_stop_rgba(0.0, *orange1) - markerclr.add_color_stop_rgba(0.5, *orange0) - markerclr.add_color_stop_rgba(1.0, *orange0) + markerclr.add_color_stop_rgba(0.0, 1.0, 1.0, 1.0, 0.0) + markerclr.add_color_stop_rgba(0.5, 1.0, 1.0, 1.0, 0.75) + markerclr.add_color_stop_rgba(1.0, 1.0, 1.0, 1.0, 1.0) self.lightclr = lightclr self.darkclr = darkclr @@ -84,7 +84,10 @@ class SongPosition(gtk.DrawingArea): context.fill() def set_position(self, pos): - assert 0 <= pos <= 1 + if pos < 0.0: + pos = 0.0 + elif pos > 1.0: + pos = 1.0 self.pos = pos self.invalidate()