X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FScreen.cc;h=d92dec3502cb54a66c3e4050600fc6044ed124c8;hb=a1b96061eb78c44ddb5fda026efb6ba7b52c93af;hp=acde773640a5007749a35f17d1fe705ed6f9aa78;hpb=266a35a943d0202b0e450b1f4e5313bce2de367b;p=chaz%2Fopenbox diff --git a/src/Screen.cc b/src/Screen.cc index acde7736..d92dec35 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -974,10 +974,19 @@ void BScreen::LoadStyle(void) { readDatabaseTexture("window.button.unfocus", "black", style); resource.wstyle.b_pressed = readDatabaseTexture("window.button.pressed", "black", style); - resource.wstyle.f_focus = - readDatabaseColor("window.frame.focusColor", "white", style); - resource.wstyle.f_unfocus = - readDatabaseColor("window.frame.unfocusColor", "black", style); + + // we create the window.frame texture by hand because it exists only to + // make the code cleaner and is not actually used for display + BColor color = readDatabaseColor("window.frame.focusColor", "white", style); + resource.wstyle.f_focus = BTexture("solid flat", getBaseDisplay(), + getScreenNumber(), image_control); + resource.wstyle.f_focus.setColor(color); + + color = readDatabaseColor("window.frame.unfocusColor", "white", style); + resource.wstyle.f_unfocus = BTexture("solid flat", getBaseDisplay(), + getScreenNumber(), image_control); + resource.wstyle.f_unfocus.setColor(color); + resource.wstyle.l_text_focus = readDatabaseColor("window.label.focus.textColor", "black", style); resource.wstyle.l_text_unfocus = @@ -995,7 +1004,17 @@ void BScreen::LoadStyle(void) { resource.wstyle.justify = CenterJustify; } - // load toolbar config + // sanity checks + if (resource.wstyle.t_focus.texture() == BTexture::Parent_Relative) + resource.wstyle.t_focus = resource.wstyle.f_focus; + if (resource.wstyle.t_unfocus.texture() == BTexture::Parent_Relative) + resource.wstyle.t_unfocus = resource.wstyle.f_unfocus; + if (resource.wstyle.h_focus.texture() == BTexture::Parent_Relative) + resource.wstyle.h_focus = resource.wstyle.f_focus; + if (resource.wstyle.h_unfocus.texture() == BTexture::Parent_Relative) + resource.wstyle.h_unfocus = resource.wstyle.f_unfocus; + +// load toolbar config resource.tstyle.toolbar = readDatabaseTexture("toolbar", "black", style); resource.tstyle.label = @@ -1025,6 +1044,14 @@ void BScreen::LoadStyle(void) { resource.tstyle.justify = CenterJustify; } + // sanity checks + if (resource.tstyle.toolbar.texture() == BTexture::Parent_Relative) { + resource.tstyle.toolbar = BTexture("solid flat", getBaseDisplay(), + getScreenNumber(), image_control); + resource.tstyle.toolbar.setColor(BColor("black", getBaseDisplay(), + getScreenNumber())); + } + // load menu config resource.mstyle.title = readDatabaseTexture("menu.title", "white", style); @@ -1073,6 +1100,14 @@ void BScreen::LoadStyle(void) { resource.mstyle.bullet_pos = Basemenu::Right; } + // sanity checks + if (resource.mstyle.frame.texture() == BTexture::Parent_Relative) { + resource.mstyle.frame = BTexture("solid flat", getBaseDisplay(), + getScreenNumber(), image_control); + resource.mstyle.frame.setColor(BColor("black", getBaseDisplay(), + getScreenNumber())); + } + resource.border_color = readDatabaseColor("borderColor", "black", style); @@ -2422,18 +2457,10 @@ BTexture BScreen::readDatabaseTexture(const string &rname, texture.setDisplay(getBaseDisplay(), getScreenNumber()); texture.setImageControl(image_control); - if (texture.texture() & BTexture::Solid) { - texture.setColor(readDatabaseColor(rname + ".color", - default_color, style)); - texture.setColorTo(readDatabaseColor(rname + ".colorTo", - default_color, style)); - } else if (texture.texture() & BTexture::Gradient) { - texture.setColor(readDatabaseColor(rname + ".color", - default_color, style)); - texture.setColorTo(readDatabaseColor(rname + ".colorTo", - default_color, style)); - } - + texture.setColor(readDatabaseColor(rname + ".color", default_color, style)); + texture.setColorTo(readDatabaseColor(rname + ".colorTo", default_color, + style)); + return texture; }