- readDatabaseTexture("window.title.focus", "Window.Title.Focus",
- &resource.wstyle.t_focus,
- WhitePixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("window.title.unfocus", "Window.Title.Unfocus",
- &resource.wstyle.t_unfocus,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("window.label.focus", "Window.Label.Focus",
- &resource.wstyle.l_focus,
- WhitePixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("window.label.unfocus", "Window.Label.Unfocus",
- &resource.wstyle.l_unfocus,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("window.handle.focus", "Window.Handle.Focus",
- &resource.wstyle.h_focus,
- WhitePixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("window.handle.unfocus", "Window.Handle.Unfocus",
- &resource.wstyle.h_unfocus,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("window.grip.focus", "Window.Grip.Focus",
- &resource.wstyle.g_focus,
- WhitePixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("window.grip.unfocus", "Window.Grip.Unfocus",
- &resource.wstyle.g_unfocus,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("window.button.focus", "Window.Button.Focus",
- &resource.wstyle.b_focus,
- WhitePixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("window.button.unfocus", "Window.Button.Unfocus",
- &resource.wstyle.b_unfocus,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("window.button.pressed", "Window.Button.Pressed",
- &resource.wstyle.b_pressed,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseColor("window.frame.focusColor",
- "Window.Frame.FocusColor",
- &resource.wstyle.f_focus,
- WhitePixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseColor("window.frame.unfocusColor",
- "Window.Frame.UnfocusColor",
- &resource.wstyle.f_unfocus,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseColor("window.label.focus.textColor",
- "Window.Label.Focus.TextColor",
- &resource.wstyle.l_text_focus,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseColor("window.label.unfocus.textColor",
- "Window.Label.Unfocus.TextColor",
- &resource.wstyle.l_text_unfocus,
- WhitePixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseColor("window.button.focus.picColor",
- "Window.Button.Focus.PicColor",
- &resource.wstyle.b_pic_focus,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseColor("window.button.unfocus.picColor",
- "Window.Button.Unfocus.PicColor",
- &resource.wstyle.b_pic_unfocus,
- WhitePixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
-
- if (conf.getValue("window.justify", "Window.Justify", s)) {
- if (0 == strncasecmp(s.c_str(), "right", s.length()))
- resource.wstyle.justify = BScreen::RightJustify;
- else if (0 == strncasecmp(s.c_str(), "center", s.length()))
- resource.wstyle.justify = BScreen::CenterJustify;
- else
- resource.wstyle.justify = BScreen::LeftJustify;
- } else
- resource.wstyle.justify = BScreen::LeftJustify;
-
- // load toolbar config
- readDatabaseTexture("toolbar", "Toolbar",
- &resource.tstyle.toolbar,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("toolbar.label", "Toolbar.Label",
- &resource.tstyle.label,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("toolbar.windowLabel", "Toolbar.WindowLabel",
- &resource.tstyle.window,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("toolbar.button", "Toolbar.Button",
- &resource.tstyle.button,
- WhitePixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("toolbar.button.pressed", "Toolbar.Button.Pressed",
- &resource.tstyle.pressed,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseTexture("toolbar.clock", "Toolbar.Clock",
- &resource.tstyle.clock,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseColor("toolbar.label.textColor", "Toolbar.Label.TextColor",
- &resource.tstyle.l_text,
- WhitePixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseColor("toolbar.windowLabel.textColor",
- "Toolbar.WindowLabel.TextColor",
- &resource.tstyle.w_text,
- WhitePixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseColor("toolbar.clock.textColor", "Toolbar.Clock.TextColor",
- &resource.tstyle.c_text,
- WhitePixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
- readDatabaseColor("toolbar.button.picColor", "Toolbar.Button.PicColor",
- &resource.tstyle.b_pic,
- BlackPixel(getBaseDisplay().getXDisplay(),
- getScreenNumber()));
-
- if (conf.getValue("toolbar.justify", "Toolbar.Justify", s)) {
- if (0 == strncasecmp(s.c_str(), "right", s.length()))
- resource.tstyle.justify = BScreen::RightJustify;
- else if (0 == strncasecmp(s.c_str(), "center", s.length()))
- resource.tstyle.justify = BScreen::CenterJustify;
- else
- resource.tstyle.justify = BScreen::LeftJustify;
- } else
- resource.tstyle.justify = BScreen::LeftJustify;
+ resource.wstyle.t_focus =
+ readDatabaseTexture("window.title.focus", "white", style);
+ resource.wstyle.t_unfocus =
+ readDatabaseTexture("window.title.unfocus", "black", style);
+ resource.wstyle.l_focus =
+ readDatabaseTexture("window.label.focus", "white", style);
+ resource.wstyle.l_unfocus =
+ readDatabaseTexture("window.label.unfocus", "black", style);
+ resource.wstyle.h_focus =
+ readDatabaseTexture("window.handle.focus", "white", style);
+ resource.wstyle.h_unfocus =
+ readDatabaseTexture("window.handle.unfocus", "black", style);
+ resource.wstyle.g_focus =
+ readDatabaseTexture("window.grip.focus", "white", style);
+ resource.wstyle.g_unfocus =
+ readDatabaseTexture("window.grip.unfocus", "black", style);
+ resource.wstyle.b_focus =
+ readDatabaseTexture("window.button.focus", "white", style);
+ resource.wstyle.b_unfocus =
+ readDatabaseTexture("window.button.unfocus", "black", style);
+ resource.wstyle.b_pressed =
+ readDatabaseTexture("window.button.pressed", "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 =
+ readDatabaseColor("window.label.unfocus.textColor", "white", style);
+ resource.wstyle.b_pic_focus =
+ readDatabaseColor("window.button.focus.picColor", "black", style);
+ resource.wstyle.b_pic_unfocus =
+ readDatabaseColor("window.button.unfocus.picColor", "white", style);
+
+ resource.wstyle.justify = LeftJustify;
+ if (style.getValue("window.justify", s)) {
+ if (s == "right" || s == "Right")
+ resource.wstyle.justify = RightJustify;
+ else if (s == "center" || s == "Center")
+ resource.wstyle.justify = CenterJustify;
+ }
+
+ // 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 =
+ readDatabaseTexture("toolbar.label", "black", style);
+ resource.tstyle.window =
+ readDatabaseTexture("toolbar.windowLabel", "black", style);
+ resource.tstyle.button =
+ readDatabaseTexture("toolbar.button", "white", style);
+ resource.tstyle.pressed =
+ readDatabaseTexture("toolbar.button.pressed", "black", style);
+ resource.tstyle.clock =
+ readDatabaseTexture("toolbar.clock", "black", style);
+ resource.tstyle.l_text =
+ readDatabaseColor("toolbar.label.textColor", "white", style);
+ resource.tstyle.w_text =
+ readDatabaseColor("toolbar.windowLabel.textColor", "white", style);
+ resource.tstyle.c_text =
+ readDatabaseColor("toolbar.clock.textColor", "white", style);
+ resource.tstyle.b_pic =
+ readDatabaseColor("toolbar.button.picColor", "black", style);
+
+ resource.tstyle.justify = LeftJustify;
+ if (style.getValue("toolbar.justify", s)) {
+ if (s == "right" || s == "Right")
+ resource.tstyle.justify = RightJustify;
+ else if (s == "center" || s == "Center")
+ 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()));
+ }