mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 20:35:42 +02:00
font: simplify configuration format; it's just a string now
This commit is contained in:
parent
314b43b4f0
commit
b1453fd65e
2 changed files with 7 additions and 7 deletions
|
@ -156,12 +156,13 @@ conf_verify_color(keychain_t *chain, const struct yml_node *node)
|
|||
bool
|
||||
conf_verify_font(keychain_t *chain, const struct yml_node *node)
|
||||
{
|
||||
static const struct attr_info attrs[] = {
|
||||
{"family", true, &conf_verify_string},
|
||||
{NULL, false, NULL},
|
||||
};
|
||||
if (!yml_is_scalar(node)) {
|
||||
LOG_ERR("%s: font must be a fontconfig-formatted string",
|
||||
conf_err_prefix(chain, node));
|
||||
return false;
|
||||
}
|
||||
|
||||
return conf_verify_dict(chain, node, attrs);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
3
config.c
3
config.c
|
@ -67,8 +67,7 @@ conf_to_color(const struct yml_node *node)
|
|||
struct font *
|
||||
conf_to_font(const struct yml_node *node)
|
||||
{
|
||||
const struct yml_node *family = yml_get_value(node, "family");
|
||||
return font_new(family != NULL ? yml_value_as_string(family) : "monospace");
|
||||
return font_new(yml_value_as_string(node));
|
||||
}
|
||||
|
||||
struct deco *
|
||||
|
|
Loading…
Add table
Reference in a new issue