Appearance *theme_a_menu_disabled;
Appearance *theme_a_menu_hilite;
+Appearance *theme_app_hilite_bg;
+Appearance *theme_app_unhilite_bg;
Appearance *theme_app_hilite_label;
Appearance *theme_app_unhilite_label;
+Appearance *theme_app_icon;
void theme_startup()
{
theme_shade_set_mask = theme_shade_unset_mask = NULL;
theme_iconify_mask = theme_close_mask = NULL;
- theme_a_focused_unpressed_max = appearance_new(Surface_Planar, 1);
- theme_a_focused_pressed_max = appearance_new(Surface_Planar, 1);
- theme_a_focused_pressed_set_max = appearance_new(Surface_Planar, 1);
- theme_a_unfocused_unpressed_max = appearance_new(Surface_Planar, 1);
- theme_a_unfocused_pressed_max = appearance_new(Surface_Planar, 1);
- theme_a_unfocused_pressed_set_max = appearance_new(Surface_Planar, 1);
+ theme_a_focused_unpressed_max = appearance_new(1);
+ theme_a_focused_pressed_max = appearance_new(1);
+ theme_a_focused_pressed_set_max = appearance_new(1);
+ theme_a_unfocused_unpressed_max = appearance_new(1);
+ theme_a_unfocused_pressed_max = appearance_new(1);
+ theme_a_unfocused_pressed_set_max = appearance_new(1);
theme_a_focused_unpressed_close = NULL;
theme_a_focused_pressed_close = NULL;
theme_a_unfocused_unpressed_close = NULL;
theme_a_focused_pressed_iconify = NULL;
theme_a_unfocused_unpressed_iconify = NULL;
theme_a_unfocused_pressed_iconify = NULL;
- theme_a_focused_grip = appearance_new(Surface_Planar, 0);
- theme_a_unfocused_grip = appearance_new(Surface_Planar, 0);
- theme_a_focused_title = appearance_new(Surface_Planar, 0);
- theme_a_unfocused_title = appearance_new(Surface_Planar, 0);
- theme_a_focused_label = appearance_new(Surface_Planar, 1);
- theme_a_unfocused_label = appearance_new(Surface_Planar, 1);
- theme_a_icon = appearance_new(Surface_Planar, 1);
- theme_a_focused_handle = appearance_new(Surface_Planar, 0);
- theme_a_unfocused_handle = appearance_new(Surface_Planar, 0);
- theme_a_menu = appearance_new(Surface_Planar, 0);
- theme_a_menu_title = appearance_new(Surface_Planar, 1);
- theme_a_menu_item = appearance_new(Surface_Planar, 1);
- theme_a_menu_disabled = appearance_new(Surface_Planar, 1);
- theme_a_menu_hilite = appearance_new(Surface_Planar, 1);
-
- theme_app_hilite_label = appearance_new(Surface_Planar, 1);
- theme_app_unhilite_label = appearance_new(Surface_Planar, 1);
+ theme_a_focused_grip = appearance_new(0);
+ theme_a_unfocused_grip = appearance_new(0);
+ theme_a_focused_title = appearance_new(0);
+ theme_a_unfocused_title = appearance_new(0);
+ theme_a_focused_label = appearance_new(1);
+ theme_a_unfocused_label = appearance_new(1);
+ theme_a_icon = appearance_new(1);
+ theme_a_focused_handle = appearance_new(0);
+ theme_a_unfocused_handle = appearance_new(0);
+ theme_a_menu = appearance_new(0);
+ theme_a_menu_title = appearance_new(1);
+ theme_a_menu_item = appearance_new(1);
+ theme_a_menu_disabled = appearance_new(1);
+ theme_a_menu_hilite = appearance_new(1);
+
+ theme_app_hilite_bg = appearance_new(0);
+ theme_app_unhilite_bg = appearance_new(0);
+ theme_app_hilite_label = appearance_new(1);
+ theme_app_unhilite_label = appearance_new(1);
+ theme_app_icon = appearance_new(1);
}
appearance_free(theme_a_menu_item);
appearance_free(theme_a_menu_disabled);
appearance_free(theme_a_menu_hilite);
+ appearance_free(theme_app_hilite_bg);
+ appearance_free(theme_app_unhilite_bg);
appearance_free(theme_app_hilite_label);
appearance_free(theme_app_unhilite_label);
+ appearance_free(theme_app_icon);
}
static XrmDatabase loaddb(char *theme)
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
retvalue.addr != NULL) {
- button_dir = g_strdup_printf("%s_buttons", theme);
+ button_dir = g_strdup_printf("%s_data", theme);
s = g_build_filename(g_get_home_dir(), ".openbox", "themes",
button_dir, retvalue.addr, NULL);
g_free(s);
themename = g_path_get_basename(theme);
- s = g_strdup_printf("%s/%s_buttons/%s", theme,
+ s = g_strdup_printf("%s/%s_data/%s", theme,
themename, retvalue.addr);
g_free(themename);
if (XReadBitmapFileData(s, &w, &h, &b, &hx, &hy) ==
else if (strstr(tex, "pipecross") != NULL)
*grad = Background_PipeCross;
else if (strstr(tex, "elliptic") != NULL)
- *grad = Background_Elliptic;
+ *grad = Background_Rectangle;
else if (strstr(tex, "horizontal") != NULL)
*grad = Background_Horizontal;
else if (strstr(tex, "vertical") != NULL)
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
retvalue.addr != NULL) {
parse_appearance(retvalue.addr,
- &value->surface.data.planar.grad,
- &value->surface.data.planar.relief,
- &value->surface.data.planar.bevel,
- &value->surface.data.planar.interlaced,
- &value->surface.data.planar.border);
- if (!read_color(db, cname, &value->surface.data.planar.primary))
- value->surface.data.planar.primary = color_new(0, 0, 0);
- if (!read_color(db, ctoname, &value->surface.data.planar.secondary))
- value->surface.data.planar.secondary = color_new(0, 0, 0);
- if (value->surface.data.planar.border)
+ &value->surface.grad,
+ &value->surface.relief,
+ &value->surface.bevel,
+ &value->surface.interlaced,
+ &value->surface.border);
+ if (!read_color(db, cname, &value->surface.primary))
+ value->surface.primary = color_new(0, 0, 0);
+ if (!read_color(db, ctoname, &value->surface.secondary))
+ value->surface.secondary = color_new(0, 0, 0);
+ if (value->surface.border)
if (!read_color(db, bcname,
- &value->surface.data.planar.border_color))
- value->surface.data.planar.border_color = color_new(0, 0, 0);
+ &value->surface.border_color))
+ value->surface.border_color = color_new(0, 0, 0);
ret = TRUE;
}
static void set_default_appearance(Appearance *a)
{
- a->surface.data.planar.grad = Background_Solid;
- a->surface.data.planar.relief = Flat;
- a->surface.data.planar.bevel = Bevel1;
- a->surface.data.planar.interlaced = FALSE;
- a->surface.data.planar.border = FALSE;
- a->surface.data.planar.primary = color_new(0, 0, 0);
- a->surface.data.planar.secondary = color_new(0, 0, 0);
+ a->surface.grad = Background_Solid;
+ a->surface.relief = Flat;
+ a->surface.bevel = Bevel1;
+ a->surface.interlaced = FALSE;
+ a->surface.border = FALSE;
+ a->surface.primary = color_new(0, 0, 0);
+ a->surface.secondary = color_new(0, 0, 0);
}
char *theme_load(char *theme)
}
/* load the font stuff */
- font_str = "arial-8:bold";
+ font_str = "arial:bold:pixelsize=10";
theme_winfont_shadow = FALSE;
if (read_string(db, "window.xft.flags", &str)) {
if (!read_appearance(db, "menu.hilite", theme_a_menu_hilite))
set_default_appearance(theme_a_menu_hilite);
- /* read the appearances for rendering non-decorations. these cannot be
- parent-relative */
- if (theme_a_focused_label->surface.data.planar.grad !=
- Background_ParentRelative) {
- if (!read_appearance(db, "window.label.focus", theme_app_hilite_label))
- set_default_appearance(theme_app_hilite_label);
- } else {
- if (!read_appearance(db, "window.title.focus", theme_app_hilite_label))
- set_default_appearance(theme_app_hilite_label);
- }
- if (theme_a_unfocused_label->surface.data.planar.grad !=
- Background_ParentRelative) {
- if (!read_appearance(db, "window.label.unfocus",
- theme_app_unhilite_label))
- set_default_appearance(theme_app_unhilite_label);
- } else {
- if (!read_appearance(db, "window.title.unfocus",
- theme_app_unhilite_label))
- set_default_appearance(theme_app_unhilite_label);
- }
+ /* read the appearances for rendering non-decorations */
+ if (!read_appearance(db, "window.title.focus", theme_app_hilite_bg))
+ set_default_appearance(theme_app_hilite_bg);
+ if (!read_appearance(db, "window.label.focus", theme_app_hilite_label))
+ set_default_appearance(theme_app_hilite_label);
+ if (!read_appearance(db, "window.title.unfocus", theme_app_unhilite_bg))
+ set_default_appearance(theme_app_unhilite_bg);
+ if (!read_appearance(db, "window.label.unfocus", theme_app_unhilite_label))
+ set_default_appearance(theme_app_unhilite_label);
/* read buttons textures */
if (!read_appearance(db, "window.button.pressed.focus",
theme_a_focused_pressed_set_max =
appearance_copy(theme_a_focused_pressed_max);
- theme_a_icon->surface.data.planar.grad = Background_ParentRelative;
+ theme_a_icon->surface.grad = Background_ParentRelative;
/* set up the textures */
theme_a_focused_label->texture[0].type =
theme_app_hilite_label->texture[0].type = Text;
- theme_a_focused_label->texture[0].data.text.justify =
- theme_app_hilite_label->texture[0].data.text.justify = winjust;
+ theme_a_focused_label->texture[0].data.text.justify = winjust;
+ theme_app_hilite_label->texture[0].data.text.justify = Justify_Left;
theme_a_focused_label->texture[0].data.text.font =
theme_app_hilite_label->texture[0].data.text.font = theme_winfont;
theme_a_focused_label->texture[0].data.text.shadow =
theme_a_unfocused_label->texture[0].type =
theme_app_unhilite_label->texture[0].type = Text;
- theme_a_unfocused_label->texture[0].data.text.justify =
- theme_app_unhilite_label->texture[0].data.text.justify = winjust;
+ theme_a_unfocused_label->texture[0].data.text.justify = winjust;
+ theme_app_unhilite_label->texture[0].data.text.justify = Justify_Left;
theme_a_unfocused_label->texture[0].data.text.font =
theme_app_unhilite_label->texture[0].data.text.font = theme_winfont;
theme_a_unfocused_label->texture[0].data.text.shadow =
theme_mtitlefont_shadow_tint;
theme_a_menu_title->texture[0].data.text.color = theme_menu_title_color;
- theme_a_menu_item->surface.data.planar.grad =
- theme_a_menu_disabled->surface.data.planar.grad =
- Background_ParentRelative;
+ theme_a_menu_item->surface.grad =
+ theme_a_menu_disabled->surface.grad =
+ theme_app_icon->surface.grad = Background_ParentRelative;
theme_a_menu_item->texture[0].type =
theme_a_menu_disabled->texture[0].type =