From f800fbf6f28138e24d6214c988406d700d008caa Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Tue, 14 Nov 2023 21:56:25 +0530 Subject: [PATCH] more colour definitions and coordinate definitions --- screen.h | 6 ++++++ vfo.c | 28 ++++++++++++---------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/screen.h b/screen.h index b92ccfa..8d71b8f 100644 --- 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 6e0f0a3..33ba206 100644 --- 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); -- 2.45.2