]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
more colour definitions and coordinate definitions
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Tue, 14 Nov 2023 16:26:25 +0000 (21:56 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Tue, 14 Nov 2023 16:26:25 +0000 (21:56 +0530)
screen.h
vfo.c

index b92ccfacaa6b603d0786ac8e4e8b5208875114cd..8d71b8f58cd8551138f38951ada3f73e658307d5 100644 (file)
--- a/screen.h
+++ b/screen.h
@@ -45,6 +45,9 @@
 #define  DARK_GREEN_G (0.65)
 #define  DARK_GREEN_B (0.0)
 
+#define  GREY_R (0.7)
+#define  GREY_G (0.7)
+#define  GREY_B (0.7)
 
 // font/typeface sizes
 
@@ -52,6 +55,7 @@
 #define  VFO_A_RENDER_FONT_SIZE     (70)
 #define  VFO_B_RENDER_FONT_SIZE     (18)
 #define  ACTIVE_VFO_INDICATION_SIZE (18)
+#define  PS_RENDER_FONT_SIZE        (12)
 
 // coordinates
 
@@ -67,4 +71,6 @@
 #define  ACTIVE_VFO_INDICATION_X  400
 #define  ACTIVE_VFO_INDICATION_Y   20
 
+#define  PS_X       130
+#define  PS_Y       50
 #endif // _SCREEN_H
diff --git a/vfo.c b/vfo.c
index 6e0f0a3ed264b6b83f8b965ce8c128898220c27d..33ba206fa23518702f6c952f55855b1e75d8d860 100644 (file)
--- a/vfo.c
+++ b/vfo.c
@@ -1168,31 +1168,27 @@ void vfo_update(void) {
 
 #ifdef PURESIGNAL
         if (can_transmit) {
-            cairo_move_to(cr, 130, 50);
+            cairo_move_to(cr, PS_X, PS_Y);
             if (transmitter->puresignal) {
-                cairo_set_source_rgb(cr, 1.0, 1.0, 0.0);
+                cairo_set_source_rgb(cr,
+                                    YELLOW_R,
+                                    YELLOW_G,
+                                    YELLOW_B);
             } else {
-                cairo_set_source_rgb(cr, 0.7, 0.7, 0.7);
+                cairo_set_source_rgb(cr,
+                                    GREY_R,
+                                    GREY_G,
+                                    GREY_B);
             }
-            cairo_set_font_size(cr, 12);
+            cairo_set_font_size(cr, PS_RENDER_FONT_SIZE);
             cairo_show_text(cr, "PS");
         }
 #endif
 
-        /* cairo_move_to(cr, 580, 20); */
-        /* if(active_receiver->zoom>1) { */
-        /*   cairo_set_source_rgb(cr, 1.0, 1.0, 0.0); */
-        /* } else { */
-        /*   cairo_set_source_rgb(cr, 0.7, 0.7, 0.7); */
-        /* } */
-        /* cairo_set_font_size(cr, 18); */
-        /* sprintf(temp_text,"ZOOM x%d",active_receiver->zoom); */
-        /* cairo_show_text(cr, temp_text); */
-
         if (vfo[id].rit_enabled == 0) {
-            cairo_set_source_rgb(cr, 0.7, 0.7, 0.7);
+            cairo_set_source_rgb(cr, GREY_R, GREY_G, GREY_B);
         } else {
-            cairo_set_source_rgb(cr, 0.0, 1.0, 0.0);
+            cairo_set_source_rgb(cr, GREEN_R, GREEN_G, GREEN_B);
         }
         sprintf(temp_text, "RIT: %lld", vfo[id].rit);
         cairo_move_to(cr, 220, 40);