[Xfce4-commits] <parole:bluesabre/gtk3> Add some minimal cairo-drawing to the GtkOverlay Mainly to illustrate spacing problems and help test/fix them

Simon Steinbeiss noreply at xfce.org
Tue Sep 3 11:12:01 CEST 2013


Updating branch refs/heads/bluesabre/gtk3
         to e55884cbfff3c2bc36e1b8d58b4ff87da4fc83fa (commit)
       from 97c2d23589e6b3f916107c7c8a9ddf056fab8f44 (commit)

commit e55884cbfff3c2bc36e1b8d58b4ff87da4fc83fa
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Tue Sep 3 11:11:38 2013 +0200

    Add some minimal cairo-drawing to the GtkOverlay
    Mainly to illustrate spacing problems and help test/fix them

 src/parole-player.c |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/parole-player.c b/src/parole-player.c
index 9782544..7d087f1 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -108,7 +108,9 @@ static void parole_player_disc_selected_cb          (ParoleDisc *disc,
                                                      ParolePlayer *player);
 
 static void parole_player_select_custom_subtitle    (GtkMenuItem *widget, gpointer data);
-                                
+
+static gboolean parole_overlay_expose_event        (GtkWidget *widget, cairo_t *cr, gpointer user_data);
+
 static gboolean parole_audiobox_expose_event        (GtkWidget *w, GdkEventExpose *ev, ParolePlayer *player);
 
 /*
@@ -2670,6 +2672,18 @@ on_bug_report_clicked (GtkWidget *w, ParolePlayer *player)
 }
 
 static gboolean
+parole_overlay_expose_event (GtkWidget *widget, cairo_t *cr, gpointer user_data)
+{
+    GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
+    /* Draw a simple rectangular border around the GtkOverlay */
+    gtk_widget_get_allocation(widget, allocation);
+    cairo_rectangle (cr, 0, 0, allocation->width, allocation->height);
+    cairo_set_source_rgba (cr, 0.95, 0.95, 0.95, 0.3);
+    cairo_stroke (cr);
+    return FALSE;
+}
+
+static gboolean
 parole_audiobox_expose_event (GtkWidget *w, GdkEventExpose *ev, ParolePlayer *player)
 {
     GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
@@ -3153,7 +3167,7 @@ parole_player_init (ParolePlayer *player)
     /* Show/Hide Playlist button */
     player->priv->show_hide_playlist_button = GTK_WIDGET (gtk_builder_get_object (builder, "media_toggleplaylist"));
     /* End Media Controls */
-
+    g_signal_connect(player->priv->control, "draw", G_CALLBACK(parole_overlay_expose_event), NULL);
     
     /* Info Bar */
     /* placeholder widget */


More information about the Xfce4-commits mailing list