summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorraveit <[email protected]>2013-03-03 10:33:37 +0100
committerraveit <[email protected]>2013-03-03 10:33:37 +0100
commitade734bde5aaf05d5ffefa8eb100de4b93e371d6 (patch)
treefc7423c36acf9298e580719e6609a07282de3121 /applets
parentb10ccd46e6d2d70f7639ec076c1f746803cd2e55 (diff)
downloadmate-panel-ade734bde5aaf05d5ffefa8eb100de4b93e371d6.tar.bz2
mate-panel-ade734bde5aaf05d5ffefa8eb100de4b93e371d6.tar.xz
add transparency background function for workspace-switcher
Diffstat (limited to 'applets')
-rw-r--r--applets/wncklet/workspace-switcher.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/applets/wncklet/workspace-switcher.c b/applets/wncklet/workspace-switcher.c
index 474f84ec..36dfe177 100644
--- a/applets/wncklet/workspace-switcher.c
+++ b/applets/wncklet/workspace-switcher.c
@@ -194,17 +194,34 @@ static void applet_change_orient(MatePanelApplet* applet, MatePanelAppletOrient
static void applet_change_background(MatePanelApplet* applet, MatePanelAppletBackgroundType type, GdkColor* color, GdkPixmap* pixmap, PagerData* pager)
{
+ /* taken from the TrashApplet */
+ GtkRcStyle *rc_style;
+ GtkStyle *style;
+
+ /* reset style */
+ gtk_widget_set_style (GTK_WIDGET (pager->pager), NULL);
+ rc_style = gtk_rc_style_new ();
+ gtk_widget_modify_style (GTK_WIDGET (pager->pager), rc_style);
+ g_object_unref (rc_style);
+
switch (type)
{
- case PANEL_NO_BACKGROUND:
- matewnck_pager_set_shadow_type(MATEWNCK_PAGER(pager->pager), GTK_SHADOW_IN);
- break;
- case PANEL_COLOR_BACKGROUND:
- matewnck_pager_set_shadow_type(MATEWNCK_PAGER(pager->pager), GTK_SHADOW_NONE);
- break;
- case PANEL_PIXMAP_BACKGROUND:
- matewnck_pager_set_shadow_type(MATEWNCK_PAGER(pager->pager), GTK_SHADOW_NONE);
- break;
+ case PANEL_COLOR_BACKGROUND:
+ gtk_widget_modify_bg (GTK_WIDGET (pager->pager), GTK_STATE_NORMAL, color);
+ break;
+
+ case PANEL_PIXMAP_BACKGROUND:
+ style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET (pager->pager)));
+ 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 (pager->pager), style);
+ g_object_unref (style);
+ break;
+
+ case PANEL_NO_BACKGROUND:
+ default:
+ break;
}
}