diff options
author | Monsta <[email protected]> | 2015-08-31 15:39:09 +0300 |
---|---|---|
committer | Monsta <[email protected]> | 2015-08-31 15:39:09 +0300 |
commit | e6e51a29a89cc95019d5e97b36ba48803c5cd58b (patch) | |
tree | 9ff8ba13674223a2b80e0c2e255d08a3187220e7 /geyes | |
parent | eaeeb5712bf0a31d139c556c25042f8ca14ba4f1 (diff) | |
download | mate-applets-e6e51a29a89cc95019d5e97b36ba48803c5cd58b.tar.bz2 mate-applets-e6e51a29a89cc95019d5e97b36ba48803c5cd58b.tar.xz |
geyes: have applet background automatically painted
Diffstat (limited to 'geyes')
-rw-r--r-- | geyes/geyes.c | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/geyes/geyes.c b/geyes/geyes.c index 1652aaf3..34599102 100644 --- a/geyes/geyes.c +++ b/geyes/geyes.c @@ -32,54 +32,6 @@ #define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y) #endif -static void -applet_back_change (MatePanelApplet *a, - MatePanelAppletBackgroundType type, - GdkColor *color, -#if GTK_CHECK_VERSION (3, 0, 0) - cairo_pattern_t *pattern, -#else - GdkPixmap *pixmap, -#endif - EyesApplet *eyes_applet) -{ -#if !GTK_CHECK_VERSION (3, 0, 0) - /* taken from the TrashApplet */ - GtkRcStyle *rc_style; - GtkStyle *style; - - /* reset style */ - gtk_widget_set_style (GTK_WIDGET (eyes_applet->applet), NULL); - rc_style = gtk_rc_style_new (); - gtk_widget_modify_style (GTK_WIDGET (eyes_applet->applet), rc_style); - g_object_unref (rc_style); - - switch (type) { - case PANEL_COLOR_BACKGROUND: - gtk_widget_modify_bg (GTK_WIDGET (eyes_applet->applet), - GTK_STATE_NORMAL, color); - break; - - case PANEL_PIXMAP_BACKGROUND: - style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET ( - eyes_applet->applet))); - if (style->bg_pixmap[GTK_STATE_NORMAL]) - g_object_unref - (style->bg_pixmap[GTK_STATE_NORMAL]); - style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref - (pixmap); - gtk_widget_set_style (GTK_WIDGET (eyes_applet->applet), - style); - g_object_unref (style); - break; - - case PANEL_NO_BACKGROUND: - default: - break; - } -#endif -} - /* TODO - Optimize this a bit */ static void calculate_pupil_xy (EyesApplet *eyes_applet, @@ -422,6 +374,7 @@ geyes_applet_fill (MatePanelApplet *applet) gtk_window_set_default_icon_name ("mate-eyes-applet"); mate_panel_applet_set_flags (applet, MATE_PANEL_APPLET_EXPAND_MINOR); + mate_panel_applet_set_background_widget (applet, GTK_WIDGET (applet)); eyes_applet = create_eyes (applet); @@ -452,10 +405,6 @@ geyes_applet_fill (MatePanelApplet *applet) set_atk_name_description (GTK_WIDGET (eyes_applet->applet), _("Eyes"), _("The eyes look in the direction of the mouse pointer")); - g_signal_connect (eyes_applet->applet, - "change_background", - G_CALLBACK (applet_back_change), - eyes_applet); g_signal_connect (eyes_applet->vbox, "dispose", G_CALLBACK (dispose_cb), |