mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
theme: fix pattern match bug
Remove 'else' from if-statements in order for the pattern match to apply to more than just the first instance of each match.
This commit is contained in:
parent
8f8a6dfea1
commit
be942a6413
1 changed files with 25 additions and 10 deletions
35
src/theme.c
35
src/theme.c
|
|
@ -91,31 +91,46 @@ static void entry(struct theme *theme, const char *key, const char *value)
|
|||
if (!key || !value) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note that in order for the pattern match to apply to more than just
|
||||
* the first instance, "else if" cannot be used throughout this function
|
||||
*/
|
||||
if (match(key, "border.width")) {
|
||||
theme->border_width = atoi(value);
|
||||
}
|
||||
|
||||
} else if (match(key, "window.active.border.color")) {
|
||||
if (match(key, "window.active.border.color")) {
|
||||
parse_hexstr(value, theme->window_active_border_color);
|
||||
} else if (match(key, "window.inactive.border.color")) {
|
||||
}
|
||||
if (match(key, "window.inactive.border.color")) {
|
||||
parse_hexstr(value, theme->window_inactive_border_color);
|
||||
}
|
||||
|
||||
} else if (match(key, "window.active.title.bg.color")) {
|
||||
if (match(key, "window.active.title.bg.color")) {
|
||||
parse_hexstr(value, theme->window_active_title_bg_color);
|
||||
} else if (match(key, "window.inactive.title.bg.color")) {
|
||||
}
|
||||
if (match(key, "window.inactive.title.bg.color")) {
|
||||
parse_hexstr(value, theme->window_inactive_title_bg_color);
|
||||
}
|
||||
|
||||
} else if (match(key, "window.active.button.unpressed.image.color")) {
|
||||
if (match(key, "window.active.button.unpressed.image.color")) {
|
||||
parse_hexstr(value, theme->window_active_button_unpressed_image_color);
|
||||
} else if (match(key, "window.inactive.button.unpressed.image.color")) {
|
||||
}
|
||||
if (match(key, "window.inactive.button.unpressed.image.color")) {
|
||||
parse_hexstr(value, theme->window_inactive_button_unpressed_image_color);
|
||||
}
|
||||
|
||||
} else if (match(key, "menu.items.bg.color")) {
|
||||
if (match(key, "menu.items.bg.color")) {
|
||||
parse_hexstr(value, theme->menu_items_bg_color);
|
||||
} else if (match(key, "menu.items.text.color")) {
|
||||
}
|
||||
if (match(key, "menu.items.text.color")) {
|
||||
parse_hexstr(value, theme->menu_items_text_color);
|
||||
} else if (match(key, "menu.items.active.bg.color")) {
|
||||
}
|
||||
if (match(key, "menu.items.active.bg.color")) {
|
||||
parse_hexstr(value, theme->menu_items_active_bg_color);
|
||||
} else if (match(key, "menu.items.active.text.color")) {
|
||||
}
|
||||
if (match(key, "menu.items.active.text.color")) {
|
||||
parse_hexstr(value, theme->menu_items_active_text_color);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue