diff options
author | monsta <[email protected]> | 2016-02-15 11:34:31 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-02-15 11:34:31 +0300 |
commit | 22516191381198c85e4e480c7603e5827ac17349 (patch) | |
tree | 69f10f942fc058a897123a114c78c2b003f5ab0e | |
parent | 22f9464fd696c35fd31d6ba6311438c9303f32f6 (diff) | |
download | mate-panel-22516191381198c85e4e480c7603e5827ac17349.tar.bz2 mate-panel-22516191381198c85e4e480c7603e5827ac17349.tar.xz |
panel-profile: less #if's again
-rw-r--r-- | mate-panel/panel-profile.c | 76 |
1 files changed, 34 insertions, 42 deletions
diff --git a/mate-panel/panel-profile.c b/mate-panel/panel-profile.c index 9fd0a058..b5bb9078 100644 --- a/mate-panel/panel-profile.c +++ b/mate-panel/panel-profile.c @@ -238,34 +238,14 @@ panel_profile_set_background_color (PanelToplevel *toplevel, { panel_profile_set_background_gdk_rgba (toplevel, color); } -#else -void -panel_profile_set_background_color (PanelToplevel *toplevel, - PanelColor *color) -{ - panel_profile_set_background_gdk_color (toplevel, &color->gdk); - panel_profile_set_background_opacity (toplevel, color->alpha); -} -#endif -#if GTK_CHECK_VERSION (3, 0, 0) void panel_profile_get_background_color (PanelToplevel *toplevel, GdkRGBA *color) { panel_profile_get_background_gdk_rgba (toplevel, color); } -#else -void -panel_profile_get_background_color (PanelToplevel *toplevel, - PanelColor *color) -{ - panel_profile_get_background_gdk_color (toplevel, &(color->gdk)); - color->alpha = panel_profile_get_background_opacity (toplevel); -} -#endif -#if GTK_CHECK_VERSION (3, 0, 0) void panel_profile_set_background_gdk_rgba (PanelToplevel *toplevel, GdkRGBA *color) @@ -295,8 +275,42 @@ panel_profile_get_background_gdk_rgba (PanelToplevel *toplevel, g_free (color_str); } + +void +panel_profile_set_background_opacity (PanelToplevel *toplevel, + guint16 opacity) +{ + GdkRGBA color; + panel_profile_get_background_color (toplevel, &color); + color.alpha = opacity / 65535.0; + panel_profile_set_background_color (toplevel, &color); +} + +guint16 +panel_profile_get_background_opacity (PanelToplevel *toplevel) +{ + GdkRGBA color; + panel_profile_get_background_color (toplevel, &color); + return (guint16) round (color.alpha * 65535); +} #else void +panel_profile_set_background_color (PanelToplevel *toplevel, + PanelColor *color) +{ + panel_profile_set_background_gdk_color (toplevel, &color->gdk); + panel_profile_set_background_opacity (toplevel, color->alpha); +} + +void +panel_profile_get_background_color (PanelToplevel *toplevel, + PanelColor *color) +{ + panel_profile_get_background_gdk_color (toplevel, &(color->gdk)); + color->alpha = panel_profile_get_background_opacity (toplevel); +} + +void panel_profile_set_background_gdk_color (PanelToplevel *toplevel, GdkColor *gdk_color) { @@ -327,36 +341,14 @@ panel_profile_get_background_gdk_color (PanelToplevel *toplevel, g_free (color_str); } -#endif -#if GTK_CHECK_VERSION (3, 0, 0) -void -panel_profile_set_background_opacity (PanelToplevel *toplevel, - guint16 opacity) -{ - GdkRGBA color; - panel_profile_get_background_color (toplevel, &color); - color.alpha = opacity / 65535.0; - panel_profile_set_background_color (toplevel, &color); -} -#else void panel_profile_set_background_opacity (PanelToplevel *toplevel, guint16 opacity) { g_settings_set_int (toplevel->background_settings, "opacity", opacity); } -#endif -#if GTK_CHECK_VERSION (3, 0, 0) -guint16 -panel_profile_get_background_opacity (PanelToplevel *toplevel) -{ - GdkRGBA color; - panel_profile_get_background_color (toplevel, &color); - return (guint16) round (color.alpha * 65535); -} -#else guint16 panel_profile_get_background_opacity (PanelToplevel *toplevel) { |