aboutsummaryrefslogtreecommitdiff
path: root/src/connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/connect.c')
-rw-r--r--src/connect.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/connect.c b/src/connect.c
index 12038a4..24f6463 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -88,15 +88,19 @@ static void button_action(State *state, const char *event, int x, int y)
if (layout->x + layout->width < x) continue;
if (layout->x > x) break;
- log_debug("Button layout [x=%d, y=%d, w=%d, h=%d]",
- layout->x, layout->y, layout->width, layout->height);
-
- if (in_capsule(x, y, layout->x, layout->y, layout->width, layout->height)) {
- log_debug("Triggering action for button");
- if (layout->btn->action != NULL) {
- layout->btn->action(layout->btn);
+ if (layout->btn->simple) {
+ log_debug("Button layout [x=%d, y=%d, w=%d, h=%d]",
+ layout->x, layout->y, layout->width, layout->height);
+
+ if (in_capsule(x, y, layout->x, layout->y, layout->width, layout->height)) {
+ log_debug("Triggering action for button");
+ ButtonAction action = button_simple_get_action(layout->btn);
+ if (action != NULL) action(layout->btn);
+ return;
}
- return;
+ } else {
+ log_debug("Button group layout [x=%d, y=%d, w=%d, h=%d]",
+ layout->x, layout->y, layout->width, layout->height);
}
}