mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-06-21 01:45:40 +02:00
particle: add an 'on_click_template' to base constructor.
This is intended to be a format-like string, with the possibility to use tag formatters. The expanded string will later be passed to the system() call.
This commit is contained in:
parent
6019129acc
commit
5164d1d6ea
7 changed files with 14 additions and 7 deletions
|
@ -8,15 +8,18 @@ particle_default_destroy(struct particle *particle)
|
|||
{
|
||||
if (particle->deco != NULL)
|
||||
particle->deco->destroy(particle->deco);
|
||||
free(particle->on_click_template);
|
||||
free(particle);
|
||||
}
|
||||
|
||||
struct particle *
|
||||
particle_common_new(int left_margin, int right_margin)
|
||||
particle_common_new(int left_margin, int right_margin,
|
||||
const char *on_click_template)
|
||||
{
|
||||
struct particle *p = malloc(sizeof(*p));
|
||||
p->left_margin = left_margin;
|
||||
p->right_margin = right_margin;
|
||||
p->on_click_template = on_click_template != NULL ? strdup(on_click_template) : NULL;
|
||||
p->deco = NULL;
|
||||
return p;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue