diff options
author | Stefano Karapetsas <[email protected]> | 2013-03-17 03:35:02 -0700 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2013-03-17 03:35:02 -0700 |
commit | 3c17e43f431ddeec0f2f2d1575cad08599dc8fcf (patch) | |
tree | cf9fd3ee80661c08995aa291930a41c0dc16431f /applets | |
parent | 2d747c61c29cc1ed480cbe958010e629abc00d73 (diff) | |
parent | ade734bde5aaf05d5ffefa8eb100de4b93e371d6 (diff) | |
download | mate-panel-3c17e43f431ddeec0f2f2d1575cad08599dc8fcf.tar.bz2 mate-panel-3c17e43f431ddeec0f2f2d1575cad08599dc8fcf.tar.xz |
Merge pull request #81 from NiceandGently/master
add transparency background function for workspace-switcher
Diffstat (limited to 'applets')
-rw-r--r-- | applets/wncklet/workspace-switcher.c | 35 |
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; } } |