mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-06-16 08:15:40 +02:00
exposable: add ‘btn’ argument to on_mouse()
This commit is contained in:
parent
8f7ef7c20b
commit
dd724d1bc2
11 changed files with 69 additions and 38 deletions
|
@ -75,14 +75,14 @@ expose(const struct exposable *exposable, pixman_image_t *pix, int x, int y, int
|
|||
|
||||
static void
|
||||
on_mouse(struct exposable *exposable, struct bar *bar,
|
||||
enum mouse_event event, int x, int y)
|
||||
enum mouse_event event, enum mouse_button btn, int x, int y)
|
||||
{
|
||||
const struct particle *p = exposable->particle;
|
||||
const struct eprivate *e = exposable->private;
|
||||
|
||||
if (exposable->on_click != NULL) {
|
||||
/* We have our own handler */
|
||||
exposable_default_on_mouse(exposable, bar, event, x, y);
|
||||
exposable_default_on_mouse(exposable, bar, event, btn, x, y);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ on_mouse(struct exposable *exposable, struct bar *bar,
|
|||
if (x >= px && x < px + e->exposables[i]->width) {
|
||||
if (e->exposables[i]->on_mouse != NULL) {
|
||||
e->exposables[i]->on_mouse(
|
||||
e->exposables[i], bar, event, x - px, y);
|
||||
e->exposables[i], bar, event, btn, x - px, y);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ on_mouse(struct exposable *exposable, struct bar *bar,
|
|||
}
|
||||
|
||||
/* We're between sub-particles (or in the left/right margin) */
|
||||
exposable_default_on_mouse(exposable, bar, event, x, y);
|
||||
exposable_default_on_mouse(exposable, bar, event, btn, x, y);
|
||||
}
|
||||
|
||||
static struct exposable *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue