From 13f4bdbe83140c2e3bbb6f57ec0c1d85e3c7ea4e Mon Sep 17 00:00:00 2001 From: Reed Nightingale Date: Mon, 27 Jan 2020 22:36:01 -0800 Subject: [PATCH] Add version string to bottom right corner --- ubitx_ui.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ubitx_ui.cpp b/ubitx_ui.cpp index 321c1a8..8a26b59 100644 --- a/ubitx_ui.cpp +++ b/ubitx_ui.cpp @@ -1,9 +1,10 @@ #include #include "morse.h" +#include "nano_gui.h" #include "settings.h" #include "setup.h" #include "ubitx.h" -#include "nano_gui.h" +#include "version.h" static const unsigned int COLOR_TEXT = DISPLAY_WHITE; static const unsigned int COLOR_BACKGROUND = DISPLAY_NAVY; @@ -22,6 +23,8 @@ static const unsigned int COLOR_ACTIVE_TEXT = DISPLAY_BLACK; static const unsigned int COLOR_ACTIVE_BACKGROUND = DISPLAY_ORANGE; static const unsigned int COLOR_ACTIVE_BORDER = DISPLAY_WHITE; +static const unsigned int COLOR_VERSION_TEXT = DISPLAY_LIGHTGREY; + static const unsigned int LAYOUT_VFO_LABEL_X = 0; static const unsigned int LAYOUT_VFO_LABEL_Y = 10; static const unsigned int LAYOUT_VFO_LABEL_WIDTH = 159; @@ -42,9 +45,14 @@ static const unsigned int LAYOUT_BUTTON_PITCH_Y = 40; static const unsigned int LAYOUT_CW_TEXT_X = 0; static const unsigned int LAYOUT_CW_TEXT_Y = LAYOUT_BUTTON_Y + 3*LAYOUT_BUTTON_PITCH_Y + 1; -static const unsigned int LAYOUT_CW_TEXT_WIDTH = 320; +static const unsigned int LAYOUT_CW_TEXT_WIDTH = 220; static const unsigned int LAYOUT_CW_TEXT_HEIGHT = 36; +static const unsigned int LAYOUT_VERSION_TEXT_X = LAYOUT_CW_TEXT_X + LAYOUT_CW_TEXT_WIDTH + 1; +static const unsigned int LAYOUT_VERSION_TEXT_Y = LAYOUT_CW_TEXT_Y; +static const unsigned int LAYOUT_VERSION_TEXT_WIDTH = 320 - LAYOUT_CW_TEXT_WIDTH - 1; +static const unsigned int LAYOUT_VERSION_TEXT_HEIGHT = LAYOUT_CW_TEXT_HEIGHT; + static const unsigned int LAYOUT_TX_X = 280; static const unsigned int LAYOUT_TX_Y = LAYOUT_MODE_TEXT_Y; static const unsigned int LAYOUT_TX_WIDTH = 40; @@ -506,6 +514,11 @@ void drawCWStatus(){ displayText(b, LAYOUT_CW_TEXT_X, LAYOUT_CW_TEXT_Y, LAYOUT_CW_TEXT_WIDTH, LAYOUT_CW_TEXT_HEIGHT, COLOR_TEXT, COLOR_BACKGROUND, COLOR_BACKGROUND); } +void drawVersion() +{ + strncpy_P(b,VERSION_STRING,sizeof(b)); + displayText(b, LAYOUT_VERSION_TEXT_X, LAYOUT_VERSION_TEXT_Y, LAYOUT_VERSION_TEXT_WIDTH, LAYOUT_VERSION_TEXT_HEIGHT, COLOR_VERSION_TEXT, COLOR_BACKGROUND, COLOR_BACKGROUND); +} void drawTx(){ if (globalSettings.txActive){ @@ -518,6 +531,7 @@ void drawTx(){ } void drawStatusbar(){ drawCWStatus(); + drawVersion(); } void guiUpdate(){