From 3c13808f35019954d9e9f0949062d08dd5d6181a Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org>
Date: Tue, 14 Nov 2023 22:39:34 +0530
Subject: [PATCH] use the definitions in screen.h to determine the click area

---
 vfo.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/vfo.c b/vfo.c
index 9d9956c..d020e3f 100644
--- a/vfo.c
+++ b/vfo.c
@@ -1359,11 +1359,13 @@ static gboolean vfo_press_event_cb(GtkWidget *widget, GdkEventButton *event,
                                    gpointer data) {
     // vfo a and b are drawn at x = 280, so it is the y coordinate
     // that matters.
-    if (event->x >= 260 && event->y <= 40) {
+    if (event->x >= VFO_B_X && event->y <= VFO_B_Y) {
         // vfo B
         start_vfo(VFO_B);
         return TRUE;
-    } else if (event->x >= 260 && event->y > 40) {
+    } else if (event->x >= VFO_A_X &&
+	       event->y > VFO_B_Y &&
+	       event->y <= VFO_A_Y) {
         // vfo A
         start_vfo(VFO_A);
         return TRUE;
-- 
2.45.2