X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Ftheme.c;h=ac80d19ba52d7d58c2700e6c974b0f09a1bd0867;hb=be15e8c01c49327ff328e44bced78b220e16f132;hp=217b4e5130fe0661694a91a66a92a80438631b47;hpb=49a73ce15c6ae9ef5cce4c515a4175088e71e5cd;p=chaz%2Fopenbox diff --git a/render/theme.c b/render/theme.c index 217b4e51..ac80d19b 100644 --- a/render/theme.c +++ b/render/theme.c @@ -73,6 +73,8 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name) theme->app_hilite_bg = RrAppearanceNew(inst, 0); theme->app_unhilite_bg = RrAppearanceNew(inst, 0); + theme->app_hilite_fg = RrAppearanceNew(inst, 0); + theme->app_unhilite_fg = RrAppearanceNew(inst, 0); theme->app_hilite_label = RrAppearanceNew(inst, 1); theme->app_unhilite_label = RrAppearanceNew(inst, 1); @@ -478,6 +480,17 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name) "window.active.label.bg", theme->app_hilite_label, TRUE)) set_default_appearance(theme->app_hilite_label); + if (!read_appearance(db, inst, + "window.active.label.bg", theme->app_hilite_fg, + TRUE)) + set_default_appearance(theme->app_hilite_fg); + else if (theme->app_hilite_label->surface.grad == RR_SURFACE_PARENTREL) { + if (!read_appearance(db, inst, + "window.active.title.bg", + theme->app_hilite_fg, + FALSE)) + set_default_appearance(theme->app_hilite_fg); + } if (!read_appearance(db, inst, "window.inactive.title.bg", theme->app_unhilite_bg, FALSE)) @@ -486,6 +499,18 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name) "window.inactive.label.bg", theme->app_unhilite_label, TRUE)) set_default_appearance(theme->app_unhilite_label); + if (!read_appearance(db, inst, + "window.inactive.label.bg", theme->app_unhilite_fg, + TRUE)) + set_default_appearance(theme->app_unhilite_fg); + else if (theme->app_unhilite_label->surface.grad == RR_SURFACE_PARENTREL) { + if (!read_appearance(db, inst, + "window.inactive.title.bg", + theme->app_unhilite_fg, + FALSE)) + set_default_appearance(theme->app_unhilite_fg); + } + /* read buttons textures */ if (!read_appearance(db, inst, @@ -1022,6 +1047,8 @@ void RrThemeFree(RrTheme *theme) RrAppearanceFree(theme->a_clear_tex); RrAppearanceFree(theme->app_hilite_bg); RrAppearanceFree(theme->app_unhilite_bg); + RrAppearanceFree(theme->app_hilite_fg); + RrAppearanceFree(theme->app_unhilite_fg); RrAppearanceFree(theme->app_hilite_label); RrAppearanceFree(theme->app_unhilite_label); } @@ -1264,20 +1291,19 @@ static RrPixel32* read_c_image(gint width, gint height, const guint8 *data) RrPixel32 *im, *p; gint i; - p = im = g_memdup(OB_DEFAULT_ICON_pixel_data, - OB_DEFAULT_ICON_WIDTH * OB_DEFAULT_ICON_HEIGHT * - sizeof(RrPixel32)); + p = im = g_memdup(data, width * height * sizeof(RrPixel32)); - for (i = 0; i < OB_DEFAULT_ICON_WIDTH*OB_DEFAULT_ICON_HEIGHT; ++i) { + for (i = 0; i < width * height; ++i) { guchar a = ((*p >> 24) & 0xff); guchar b = ((*p >> 16) & 0xff); guchar g = ((*p >> 8) & 0xff); guchar r = ((*p >> 0) & 0xff); - *p++ = ((r << RrDefaultRedOffset) + - (g << RrDefaultGreenOffset) + - (b << RrDefaultBlueOffset) + - (a << RrDefaultAlphaOffset)); + *p = ((r << RrDefaultRedOffset) + + (g << RrDefaultGreenOffset) + + (b << RrDefaultBlueOffset) + + (a << RrDefaultAlphaOffset)); + p++; } return im;