diff options
author | monsta <[email protected]> | 2016-01-05 23:40:36 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-01-10 18:56:02 +0300 |
commit | 53f35b2242e75401ac667923a7b1d684d6edeb2b (patch) | |
tree | 7c38cbf8128b1a478f7dbb005d8cbd5ec2ff1efe | |
parent | fda0c79ef72e0ca4ea9b4dcd4761592eb8a0c302 (diff) | |
download | mate-panel-53f35b2242e75401ac667923a7b1d684d6edeb2b.tar.bz2 mate-panel-53f35b2242e75401ac667923a7b1d684d6edeb2b.tar.xz |
background: reduce number of #if's
-rw-r--r-- | mate-panel/panel-background.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/mate-panel/panel-background.c b/mate-panel/panel-background.c index 155963d0..8415a121 100644 --- a/mate-panel/panel-background.c +++ b/mate-panel/panel-background.c @@ -155,8 +155,8 @@ panel_background_prepare (PanelBackground *background) effective_type = panel_background_effective_type (background); switch (effective_type) { - case PANEL_BACK_NONE: #if GTK_CHECK_VERSION (3, 0, 0) + case PANEL_BACK_NONE: if (background->default_pattern) { /* the theme background-image pattern must be scaled by * the width & height of the panel so that when the @@ -173,7 +173,22 @@ panel_background_prepare (PanelBackground *background) gdk_window_set_background_pattern (background->window, background->default_pattern); + } else + gdk_window_set_background_rgba ( + background->window, &background->default_color); + break; + + case PANEL_BACK_COLOR: + if (background->has_alpha && + !gdk_window_check_composited_wm(background->window)) + set_pixbuf_background (background); + else { + gdk_window_set_background_rgba (background->window, + &background->color); + } + break; #else + case PANEL_BACK_NONE: if (background->default_pixmap) { if (background->default_pixmap != (GdkPixmap*) GDK_PARENT_RELATIVE) gdk_window_set_back_pixmap (background->window, @@ -183,41 +198,30 @@ panel_background_prepare (PanelBackground *background) gdk_window_set_back_pixmap (background->window, NULL, TRUE); -#endif } else -#if GTK_CHECK_VERSION (3, 0, 0) - gdk_window_set_background_rgba ( - background->window, &background->default_color); -#else gdk_window_set_background ( background->window, &background->default_color); -#endif break; + case PANEL_BACK_COLOR: if (background->has_alpha && -#if GTK_CHECK_VERSION (3, 0, 0) - !gdk_window_check_composited_wm(background->window)) -#else background->composited_image) -#endif set_pixbuf_background (background); else { -#if GTK_CHECK_VERSION (3, 0, 0) - gdk_window_set_background_rgba (background->window, - &background->color); -#else gdk_colormap_alloc_color ( background->colormap, &background->color.gdk, FALSE, TRUE); gdk_window_set_background ( background->window, &background->color.gdk); -#endif } break; +#endif + case PANEL_BACK_IMAGE: set_pixbuf_background (background); break; + default: g_assert_not_reached (); break; |