diff options
author | waker <wakeroid@gmail.com> | 2009-08-15 18:20:00 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2009-08-15 18:20:00 +0200 |
commit | 120fc832c6f3ff71f09dbb949882b97db45c8fc3 (patch) | |
tree | a9807f25bedcd0e8ef486411baaed01294876c40 /callbacks.c | |
parent | 79c4d58c3eee5a3e17185fc62aa58d341ed5694b (diff) |
changed seekbar drawing
Diffstat (limited to 'callbacks.c')
-rw-r--r-- | callbacks.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/callbacks.c b/callbacks.c index 0402b488..c0cc9bf5 100644 --- a/callbacks.c +++ b/callbacks.c @@ -824,9 +824,21 @@ seekbar_draw (GtkWidget *widget) { return; } float pos = 0; - if (playlist_current.codec && playlist_current.duration > 0) { - pos = playlist_current.codec->info.position / playlist_current.duration; - pos *= widget->allocation.width; + if (seekbar_moving) { + int x = seekbar_move_x; + if (x < 0) { + x = 0; + } + if (x > widget->allocation.width-1) { + x = widget->allocation.width-1; + } + pos = x; + } + else { + if (playlist_current.codec && playlist_current.duration > 0) { + pos = playlist_current.codec->info.position / playlist_current.duration; + pos *= widget->allocation.width; + } } // left if (pos > 0) { @@ -846,19 +858,6 @@ seekbar_draw (GtkWidget *widget) { cairo_fill (cr); cairo_reset_clip (cr); - if (seekbar_moving) { - gtkpl_set_cairo_source_rgb (cr, COLO_SEEKBAR_MARKER); - int x = seekbar_move_x; - if (x < 0) { - x = 0; - } - if (x > widget->allocation.width-8) { - x = widget->allocation.width-8; - } - clearlooks_rounded_rectangle (cr, x, widget->allocation.height/2-4, 8, 8, 4, 0xff); - cairo_fill (cr); - } - cairo_destroy (cr); } |