mirror of
https://github.com/labwc/labwc.git
synced 2026-04-07 08:21:20 -04:00
Add fields for button borders
This commit is contained in:
parent
43d643c878
commit
f3711b294a
2 changed files with 57 additions and 0 deletions
|
|
@ -88,6 +88,8 @@ struct theme {
|
||||||
float window_button_hover_bg_color[4];
|
float window_button_hover_bg_color[4];
|
||||||
int window_button_hover_bg_corner_radius;
|
int window_button_hover_bg_corner_radius;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Themes/textures for each active/inactive window. Indexed by
|
* Themes/textures for each active/inactive window. Indexed by
|
||||||
* ssd_active_state.
|
* ssd_active_state.
|
||||||
|
|
@ -98,6 +100,12 @@ struct theme {
|
||||||
|
|
||||||
/* TODO: add toggled/hover/pressed/disabled colors for buttons */
|
/* TODO: add toggled/hover/pressed/disabled colors for buttons */
|
||||||
float button_colors[LAB_NODE_BUTTON_LAST + 1][4];
|
float button_colors[LAB_NODE_BUTTON_LAST + 1][4];
|
||||||
|
enum border_type button_border_type;
|
||||||
|
int button_border_width;
|
||||||
|
int button_bevel_width;
|
||||||
|
float button_border_color[4];
|
||||||
|
float button_hover_border_color[4];
|
||||||
|
|
||||||
|
|
||||||
float border_color[4];
|
float border_color[4];
|
||||||
float toggled_keybinds_color[4];
|
float toggled_keybinds_color[4];
|
||||||
|
|
|
||||||
49
src/theme.c
49
src/theme.c
|
|
@ -576,6 +576,17 @@ theme_builtin(struct theme *theme)
|
||||||
theme->window[SSD_INACTIVE].title_bg.border_width = 0;
|
theme->window[SSD_INACTIVE].title_bg.border_width = 0;
|
||||||
theme->window[SSD_INACTIVE].title_bg.exclusive = FALSE;
|
theme->window[SSD_INACTIVE].title_bg.exclusive = FALSE;
|
||||||
theme->window[SSD_INACTIVE].title_bg.border_type = BORDER_NONE;
|
theme->window[SSD_INACTIVE].title_bg.border_type = BORDER_NONE;
|
||||||
|
theme->window[SSD_ACTIVE].button_border_type=BORDER_NONE;
|
||||||
|
theme->window[SSD_ACTIVE].button_border_width=0;
|
||||||
|
theme->window[SSD_ACTIVE].button_bevel_width=0;
|
||||||
|
theme->window[SSD_ACTIVE].button_border_color[0] = FLT_MIN;
|
||||||
|
theme->window[SSD_ACTIVE].button_hover_border_color[0] = FLT_MIN;
|
||||||
|
theme->window[SSD_INACTIVE].button_border_type=BORDER_NONE;
|
||||||
|
theme->window[SSD_INACTIVE].button_border_width=0;
|
||||||
|
theme->window[SSD_INACTIVE].button_bevel_width=0;
|
||||||
|
theme->window[SSD_INACTIVE].button_border_color[0] = FLT_MIN;
|
||||||
|
theme->window[SSD_INACTIVE].button_hover_border_color[0] = FLT_MIN;
|
||||||
|
|
||||||
|
|
||||||
parse_hexstr("#000000", theme->window[SSD_ACTIVE].label_text_color);
|
parse_hexstr("#000000", theme->window[SSD_ACTIVE].label_text_color);
|
||||||
parse_hexstr("#000000", theme->window[SSD_INACTIVE].label_text_color);
|
parse_hexstr("#000000", theme->window[SSD_INACTIVE].label_text_color);
|
||||||
|
|
@ -870,6 +881,44 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
value, "window.button.spacing");
|
value, "window.button.spacing");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (match_glob(key, "window.inactive.button.bg") && parse_border_type(value)) {
|
||||||
|
theme->window[SSD_INACTIVE].button_border_type= parse_border_type(value);
|
||||||
|
}
|
||||||
|
if (match_glob(key, "window.inactive.button.bg.width")) {
|
||||||
|
theme->window[SSD_INACTIVE].button_border_width = get_int_if_positive(value, "window.inactive.button.bg.width");
|
||||||
|
}
|
||||||
|
if (match_glob(key, "window.inactive.button.bg.bevel-width")) {
|
||||||
|
theme->window[SSD_INACTIVE].button_bevel_width = get_int_if_positive(value, "window.inactive.button.bg.bevel-width");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (match_glob(key, "window.inactive.button.bg.border-color")) {
|
||||||
|
parse_color(value, theme->window[SSD_INACTIVE].button_border_color);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (match_glob(key, "window.inactive.button.bg.border-hover-color")) {
|
||||||
|
parse_color(value, theme->window[SSD_INACTIVE].button_hover_border_color);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (match_glob(key, "window.active.button.bg") && parse_border_type(value)) {
|
||||||
|
theme->window[SSD_ACTIVE].button_border_type= parse_border_type(value);
|
||||||
|
}
|
||||||
|
if (match_glob(key, "window.active.button.bg.width")) {
|
||||||
|
theme->window[SSD_ACTIVE].button_border_width = get_int_if_positive(value, "window.active.button.bg.width");
|
||||||
|
}
|
||||||
|
if (match_glob(key, "window.inactive.button.bg.bevel-width")) {
|
||||||
|
theme->window[SSD_ACTIVE].button_bevel_width = get_int_if_positive(value, "window.active.button.bg.bevel-width");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (match_glob(key, "window.active.button.bg.border-color")) {
|
||||||
|
parse_color(value, theme->window[SSD_ACTIVE].button_border_color);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (match_glob(key, "window.active.button.bg.border-hover-color")) {
|
||||||
|
parse_color(value, theme->window[SSD_ACTIVE].button_hover_border_color);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* botton hover overlay */
|
/* botton hover overlay */
|
||||||
if (match_glob(key, "window.button.hover.bg.color")) {
|
if (match_glob(key, "window.button.hover.bg.color")) {
|
||||||
parse_color(value, theme->window_button_hover_bg_color);
|
parse_color(value, theme->window_button_hover_bg_color);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue