[Xfce4-commits] <parole:master> Drop gstreamer colorkey as Cairo keeps GtkOverlay on top of Video FIXME: Use theme-colors to draw instead of hardcoded white and black
Simon Steinbeiss
noreply at xfce.org
Fri Oct 11 11:51:50 CEST 2013
Updating branch refs/heads/master
to 703503a83226f4dc9c43c0286faabcf7db9fea30 (commit)
from ce6db476014edc3bbe7f92bf0e3ef121c919fc23 (commit)
commit 703503a83226f4dc9c43c0286faabcf7db9fea30
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Wed Sep 4 18:06:52 2013 +0200
Drop gstreamer colorkey as Cairo keeps GtkOverlay on top of Video
FIXME: Use theme-colors to draw instead of hardcoded white and black
src/gst/parole-gst.c | 36 ------------------------------------
src/parole-player.c | 15 ++++++++++-----
2 files changed, 10 insertions(+), 41 deletions(-)
diff --git a/src/gst/parole-gst.c b/src/gst/parole-gst.c
index f43a10c..ec7d9d7 100644
--- a/src/gst/parole-gst.c
+++ b/src/gst/parole-gst.c
@@ -466,12 +466,6 @@ static void
parole_gst_set_video_overlay (ParoleGst *gst)
{
GstElement *video_sink;
- //GtkWidget *label;
- //GtkStyleContext *context;
- //GdkRGBA *rgba;
- //gchar *converting_value, *hex_value;
- //gint hex_int;
- //char *endptr;
g_object_get (G_OBJECT (gst->priv->playbin),
"video-sink", &video_sink,
@@ -487,36 +481,6 @@ parole_gst_set_video_overlay (ParoleGst *gst)
gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (video_sink),
GDK_WINDOW_XID ( gtk_widget_get_window(GTK_WIDGET (gst)) ));
#endif
- /* The below code is an attempt to dynamically support theming on the controls.
- label = GTK_WIDGET(gtk_label_new(""));
- context = gtk_widget_get_style_context(GTK_WIDGET(label));
- gtk_style_context_add_class (context, "osd");
- gtk_style_context_get(context, GTK_STATE_FLAG_NORMAL,
- GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &rgba, NULL);
-
- hex_value = g_strdup("");
- converting_value = g_strdup_printf("%X", (int)(rgba->red * 255.0));
- if ((int)strlen(converting_value) == 1)
- hex_value = g_strjoin("", hex_value, "0", NULL);
- hex_value = g_strjoin("", hex_value, converting_value, NULL);
-
- converting_value = g_strdup_printf("%X", (int)(rgba->green * 255.0));
- if ((int)strlen(converting_value) == 1)
- hex_value = g_strjoin("", hex_value, "0", NULL);
- hex_value = g_strjoin("", hex_value, converting_value, NULL);
-
- converting_value = g_strdup_printf("%X", (int)(rgba->blue * 255.0));
- if ((int)strlen(converting_value) == 1)
- hex_value = g_strjoin("", hex_value, "0", NULL);
- hex_value = g_strjoin("", hex_value, converting_value, NULL);
-
- hex_int = (int)strtol(hex_value, &endptr, 16);
-
- g_object_set(video_sink, "autopaint-colorkey", FALSE,
- "colorkey", hex_int, NULL);
- */
- g_object_set(video_sink, "autopaint-colorkey", FALSE,
- "colorkey", 0x080810, NULL);
gst_object_unref (video_sink);
}
diff --git a/src/parole-player.c b/src/parole-player.c
index 7d087f1..658e80f 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -2675,9 +2675,18 @@ static gboolean
parole_overlay_expose_event (GtkWidget *widget, cairo_t *cr, gpointer user_data)
{
GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
+ /* FIXME: Get the theme-color and use that to draw the overlay
+ GtkStyleContext *context;
+ GdkRGBA acolor;
+ context = gtk_widget_get_style_context(GTK_WIDGET(widget));
+ gtk_style_context_get_background_color (context, GTK_STATE_NORMAL, &acolor);
+ gdk_cairo_set_source_rgba (cr, &acolor); */
+
/* Draw a simple rectangular border around the GtkOverlay */
gtk_widget_get_allocation(widget, allocation);
+ cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
cairo_rectangle (cr, 0, 0, allocation->width, allocation->height);
+ cairo_fill_preserve (cr);
cairo_set_source_rgba (cr, 0.95, 0.95, 0.95, 0.3);
cairo_stroke (cr);
return FALSE;
@@ -3130,12 +3139,8 @@ parole_player_init (ParolePlayer *player)
gtk_widget_set_margin_bottom(tmp_box, 10);
gtk_widget_set_margin_top(tmp_box, 10);
gtk_widget_set_valign(tmp_box, GTK_ALIGN_END);
- controls_style = gtk_widget_get_style_context(GTK_WIDGET(tmp_box));
- //gtk_style_context_add_class (controls_style, "osd");
- gdk_color_parse("#080810", &background);
+ controls_style = gtk_widget_get_style_context(GTK_WIDGET(controls_overlay));
gtk_style_context_add_class (controls_style, "osd");
- //gtk_widget_modify_bg(GTK_WIDGET(tmp_box), GTK_STATE_NORMAL, &background);
- gtk_widget_modify_bg(GTK_WIDGET(controls_overlay), GTK_STATE_NORMAL, &background);
gtk_widget_reparent(GTK_WIDGET(player->priv->control), tmp_box);
gtk_overlay_add_overlay(GTK_OVERLAY(controls_overlay), tmp_box);
gtk_box_set_child_packing( GTK_BOX(player->priv->control), GTK_WIDGET(player->priv->play_box), TRUE, TRUE, 2, GTK_PACK_START );
More information about the Xfce4-commits
mailing list