From: Stefan Kost Date: Tue, 19 May 2009 13:02:44 +0000 (+0300) Subject: seek: ui improvements X-Git-Tag: 1.19.3~511^2~9643 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3670c67fadda3fed1917ca596c366c7219bba3a;p=platform%2Fupstream%2Fgstreamer.git seek: ui improvements Repaint the window black on expose, as this looks nicer when resizing or using the expander. Also show time after slider, as this saves a whole line (nice on small displays). --- diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index d2dc658..861236b 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -2184,6 +2184,17 @@ bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data) } #endif +static gboolean +handle_expose_cb (GtkWidget * widget, GdkEventExpose * event, gpointer data) +{ + if (state < GST_STATE_PAUSED) { + gdk_draw_rectangle (widget->window, widget->style->black_gc, TRUE, + 0, 0, widget->allocation.width, widget->allocation.height); + } + return FALSE; +} + + static void msg_eos (GstBus * bus, GstMessage * message, GstPipeline * data) { @@ -2367,6 +2378,8 @@ main (int argc, char **argv) tips = gtk_tooltips_new (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); video_window = gtk_drawing_area_new (); + g_signal_connect (G_OBJECT (video_window), "expose-event", + G_CALLBACK (handle_expose_cb), NULL); gtk_widget_set_double_buffered (video_window, FALSE); statusbar = gtk_statusbar_new (); status_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (statusbar), "seek"); @@ -2421,6 +2434,7 @@ main (int argc, char **argv) GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.00, 100.0, 0.1, 1.0, 1.0)); hscale = gtk_hscale_new (adjustment); gtk_scale_set_digits (GTK_SCALE (hscale), 2); + gtk_scale_set_value_pos (GTK_SCALE (hscale), GTK_POS_RIGHT); #if GTK_CHECK_VERSION(2,12,0) gtk_range_set_show_fill_level (GTK_RANGE (hscale), TRUE); gtk_range_set_fill_level (GTK_RANGE (hscale), 100.0);