diff --git a/cfg_audio_type.h b/cfg_audio_type.h index cd17413..1c04615 100644 --- a/cfg_audio_type.h +++ b/cfg_audio_type.h @@ -70,7 +70,7 @@ class ViewCfgAudioType : public View { const int yRow1 = 80; // "Announcements", "Morse code" const int yRow2 = yRow1 + 52; // "Spoken word" const int yRow3 = yRow2 + 52; // "No audio" - const int yRow9 = gScreenHeight - 12; // "v1.11, Dec 13 2022" + const int yRow9 = gScreenHeight - 10; // "v1.14, Jan 22 2024" #define col1 10 // left-adjusted column of text #define xButton 160 // indented column of buttons @@ -85,14 +85,14 @@ class ViewCfgAudioType : public View { }; // clang-format off -#define nTxtSettings5 5 +#define nTxtSettings5 4 TextField txtSettings5[nTxtSettings5] = { // text x, y color {"Audio Type", -1, 20, cHIGHLIGHT, ALIGNCENTER}, // [SETTINGS] {"Announce", col1, yRow1, cVALUE}, // [ANNOUNCEMENTS] {"grids using:", col1, yRow1 + 20, cVALUE}, // [ANNOUNCEMENTS2] {PROGRAM_VERDATE, -1, yRow9, cLABEL, ALIGNCENTER}, // [COMPILED] - {"2 of 6", xPanel, 20, cFAINT}, // [PANEL] + //{"2 of 6", xPanel, 20, cFAINT}, // [PANEL] }; // clang-format on @@ -204,6 +204,7 @@ void ViewCfgAudioType::startScreen() { txtSettings5[ii].print(); } + showProgressBar(2, 6); // draw marker for advancing through settings showScreenBorder(); // optionally outline visible area showScreenCenterline(); // optionally draw alignment bar diff --git a/cfg_crossing.h b/cfg_crossing.h index c7b79bc..49f4d8c 100644 --- a/cfg_crossing.h +++ b/cfg_crossing.h @@ -61,7 +61,7 @@ class ViewCfgCrossing : public View { const int yRow1 = 70; // "Announce at", "4-Digit" const int yRow2 = yRow1 + 24; // "grid crossing" const int yRow3 = yRow1 + 68; // "6-Digit" - const int yRow9 = gScreenHeight - 12; // "v0.38, Apr 13 2021" + const int yRow9 = gScreenHeight - 10; // "v1.14, Jan 22 2024" #define col1 10 // left-adjusted column of text #define xButton 160 // indented column of buttons @@ -78,7 +78,7 @@ class ViewCfgCrossing : public View { }; // clang-format off -#define nTextCrossing 7 +#define nTextCrossing 6 TextField txtSettings4[nTextCrossing] = { // text x, y color {"Announcements", -1, 20, cHIGHLIGHT, ALIGNCENTER}, // [SETTINGS] @@ -87,7 +87,7 @@ class ViewCfgCrossing : public View { {"70 - 100 mi", xButton + 24, yRow1 + 22, cVALUE}, // [DISTANCE4] {"3 - 4 mi", xButton + 38, yRow3 + 22, cVALUE}, // [DISTANCE6] {PROGRAM_VERDATE, -1, yRow9, cLABEL, ALIGNCENTER}, // [COMPILED] - {"3 of 6", xPanel, 20, cFAINT}, // [PANEL] + //{"3 of 6", xPanel, 20, cFAINT}, // [PANEL] }; // clang-format on @@ -197,6 +197,7 @@ void ViewCfgCrossing::startScreen() { txtSettings4[ii].print(); } + showProgressBar(3, 6); // draw marker for advancing through settings showScreenBorder(); // optionally outline visible area showScreenCenterline(); // optionally draw alignment bar diff --git a/cfg_gps.h b/cfg_gps.h index 40858b0..b227374 100644 --- a/cfg_gps.h +++ b/cfg_gps.h @@ -63,7 +63,7 @@ class ViewCfgGPS : public View { const int yRow2 = yRow1 + 20; // "%d of %d" const int yRow3 = yRow2 + 52; // "Route", "GPS Receiver" const int yRow4 = yRow3 + 48; // "Simulator" - const int yRow9 = gScreenHeight - 12; // "v0.32, Feb 2 2021" + const int yRow9 = gScreenHeight - 10; // "v1.14, Jan 22 2024" #define col1 10 // left-adjusted column of text #define xButton 160 // indented column of buttons @@ -79,7 +79,7 @@ class ViewCfgGPS : public View { }; // clang-format off - #define nTextGPS 6 + #define nTextGPS 5 TextField txtSettings2[nTextGPS] = { // text x, y color {"GPS", -1, 20, cHIGHLIGHT, ALIGNCENTER}, // [SETTINGS] @@ -87,7 +87,7 @@ class ViewCfgGPS : public View { {"%d crumbs", col1, yRow2, cLABEL}, // [TRAILCOUNT] {"Route", col1, yRow3, cVALUE}, // [GPSTYPE] {PROGRAM_VERDATE, -1, yRow9, cLABEL, ALIGNCENTER}, // [COMPILED] - {"4 of 6", xPanel, 20, cFAINT}, // [PANEL] + //{"4 of 6", xPanel, 20, cFAINT}, // [PANEL] }; // clang-format on @@ -205,7 +205,8 @@ void ViewCfgGPS::startScreen() { tft->drawCircle(xCenter, yCenter, 7, cVALUE); } - updateScreen(); // fill in values immediately, don't wait for the main loop to eventually get around to it + showProgressBar(4, 6); // draw marker for advancing through settings + updateScreen(); // fill in values immediately, don't wait for the main loop to eventually get around to it showScreenCenterline(); // optionally draw alignment bar } diff --git a/cfg_reboot.h b/cfg_reboot.h index 382bf34..653247c 100644 --- a/cfg_reboot.h +++ b/cfg_reboot.h @@ -69,12 +69,12 @@ class ViewCfgReboot : public View { const int space = 30; const int half = space / 2; - const int yRow1 = 20; // title "Firmware Update" - const int yRow2 = yRow1 + space; // "This option starts bootloader mode." - const int yRow3 = yRow2 + space; // "Do you have a UF2 file?" - const int yRow4 = yRow3 + space; // "Do you want to install it?"" - const int yRow5 = yRow4 + half; // "Cancel", "Install UF2" buttons - const int yRow9 = gScreenHeight - 4; // "v1.12, Mar 30 2023" + const int yRow1 = 20; // title "Firmware Update" + const int yRow2 = yRow1 + space; // "This option starts bootloader mode." + const int yRow3 = yRow2 + space; // "Do you have a UF2 file?" + const int yRow4 = yRow3 + space; // "Do you want to install it?"" + const int yRow5 = yRow4 + half; // "Cancel", "Install UF2" buttons + const int yRow9 = gScreenHeight - 10; // "v1.14, Jan 22 2024" // ----- screen text // names for the array indexes, must be named in same order as array below @@ -90,9 +90,9 @@ class ViewCfgReboot : public View { const int left = 30; // x: left text edge const int top = 40; // y: top text row -// ----- static screen text -// clang-format off -#define nRebootValues 6 + // ----- static screen text + // clang-format off +#define nRebootValues 5 TextField txtValues[nRebootValues] = { // text x, y color {"7. Firmware Update", -1, yRow1, cHIGHLIGHT, ALIGNCENTER, eFONTSMALLEST}, // [TITLE] centered @@ -100,7 +100,7 @@ class ViewCfgReboot : public View { {"Do you have a UF2 file?", left, yRow3, cVALUE, ALIGNLEFT, eFONTSMALL}, // [LINE2] {"Do you want to install it?", left, yRow4, cVALUE, ALIGNLEFT, eFONTSMALL}, // [LINE3] {PROGRAM_VERDATE, -1, yRow9, cLABEL, ALIGNCENTER}, // [COMPILED] - {"7 of 6", xPanel, 20, cFAINT, ALIGNLEFT}, // [PANEL] + //{"7 of 6", xPanel, 20, cFAINT, ALIGNLEFT}, // [PANEL] }; enum buttonID { @@ -207,7 +207,8 @@ void ViewCfgReboot::startScreen() { tft->print(item.text); } - updateScreen(); // update UI immediately, don't wait for the main loop to eventually get around to it + showProgressBar(7, 6); // draw marker for advancing through settings + updateScreen(); // update UI immediately, don't wait for the main loop to eventually get around to it } // end startScreen() bool ViewCfgReboot::onTouch(Point touch) { diff --git a/cfg_rotation.h b/cfg_rotation.h index b49cb4b..06a6eb6 100644 --- a/cfg_rotation.h +++ b/cfg_rotation.h @@ -57,7 +57,7 @@ class ViewCfgRotation : public View { // vertical placement of text rows ---label--- ---button--- const int yRow1 = 70; // "Screen Orientation", "This edge up" const int yRow2 = yRow1 + 70; // "That edge up" - const int yRow9 = gScreenHeight - 12; // "v1.03, Jul 9 2021" + const int yRow9 = gScreenHeight - 10; // "v1.14, Jan 22 2024" #define col1 10 // left-adjusted column of text #define xButton 160 // indented column of buttons @@ -72,14 +72,14 @@ class ViewCfgRotation : public View { }; // clang-format off -#define nFields 5 +#define nFields 4 TextField txtSettings6[nFields] = { // text x, y color {"Rotation", -1, 20, cHIGHLIGHT, ALIGNCENTER}, // [SETTINGS] {"Screen", col1, yRow1, cVALUE}, // [SCREEN] {"Orientation", col1, yRow1 + 20, cVALUE}, // [ORIENTATION] {PROGRAM_VERDATE, -1, yRow9, cLABEL, ALIGNCENTER}, // [COMPILED] - {"6 of 6", xPanel, 20, cFAINT}, // [PANEL] + //{"6 of 6", xPanel, 20, cFAINT}, // [PANEL] }; // clang-format on @@ -97,7 +97,7 @@ class ViewCfgRotation : public View { }; // clang-format on -#define xLine (xButton + 80) +#define xLine (xButton + 92) #define topY 8 #define botY (gScreenHeight - 6) @@ -194,7 +194,8 @@ void ViewCfgRotation::startScreen() { tft->drawCircle(xCenter, yCenter, 7, cVALUE); } - updateScreen(); // update UI immediately, don't wait for laggy mainline loop + showProgressBar(6, 6); // draw marker for advancing through settings + updateScreen(); // update UI immediately, don't wait for laggy mainline loop } // end startScreen() bool ViewCfgRotation::onTouch(Point touch) { diff --git a/cfg_units.h b/cfg_units.h index 42d2f36..6a18834 100644 --- a/cfg_units.h +++ b/cfg_units.h @@ -56,7 +56,7 @@ class ViewCfgUnits : public View { // vertical placement of text rows ---label--- ---button--- const int yRow1 = 84; // "English", "Miles, inHg" const int yRow2 = yRow1 + 50; // "Metric", "Kilometers, hPa" - const int yRow9 = gScreenHeight - 12; // "v0.35, Feb 25 2021" + const int yRow9 = gScreenHeight - 10; // "v1.14, Jan 22 2024" #define col1 10 // left-adjusted column of text #define xButton 160 // indented column of buttons @@ -71,14 +71,14 @@ class ViewCfgUnits : public View { }; // clang-format off -#define nTextUnits 5 +#define nTextUnits 4 TextField txtSettings3[nTextUnits] = { // text x, y color {"Units", -1, 20, cHIGHLIGHT, ALIGNCENTER}, // [SETTINGS] {"English", col1, yRow1, cVALUE}, // [ENGLISH] {"Metric", col1, yRow2, cVALUE}, // [METRIC] {PROGRAM_VERDATE, -1, yRow9, cLABEL, ALIGNCENTER}, // [COMPILED] - {"5 of 6", xPanel, 20, cFAINT, ALIGNLEFT}, // [PANEL] + //{"5 of 6", xPanel, 20, cFAINT, ALIGNLEFT}, // [PANEL] }; // clang-format on @@ -136,11 +136,11 @@ void ViewCfgUnits::startScreen() { TextField::setTextDirty(txtSettings3, nTextUnits); // make sure all fields get re-printed on screen change setFontSize(eFONTSMALLEST); - drawAllIcons(); // draw gear (settings) and arrow (next screen) - showDefaultTouchTargets(); // optionally draw box around default button-touch areas + drawAllIcons(); // draw gear (settings) and arrow (next screen) + showDefaultTouchTargets(); // optionally draw box around default button-touch areas showMyTouchTargets(settings3Buttons, nButtonsUnits); // optionally show this view's touch targets - showScreenBorder(); // optionally outline visible area - showScreenCenterline(); // optionally draw visual alignment bar + showScreenBorder(); // optionally outline visible area + showScreenCenterline(); // optionally draw visual alignment bar // ----- draw text fields for (int ii = 0; ii < nTextUnits; ii++) { @@ -173,7 +173,8 @@ void ViewCfgUnits::startScreen() { tft->drawCircle(xCenter, yCenter, 7, cVALUE); } - updateScreen(); // update UI immediately, don't wait for laggy mainline loop + showProgressBar(5, 6); // draw marker for advancing through settings + updateScreen(); // update UI immediately, don't wait for laggy mainline loop } // end startScreen() void ViewCfgUnits::endScreen() { diff --git a/cfg_volume.h b/cfg_volume.h index a63d907..55b78d1 100644 --- a/cfg_volume.h +++ b/cfg_volume.h @@ -70,8 +70,9 @@ class ViewVolume : public View { // color scheme: see constants.h // vertical placement of text rows - const int yRow1 = 50; // label: "Audio Volume" - const int yRow2 = yRow1 + 30; // text: "of 10" + const int yRow1 = 50; // label: "Audio Volume" + const int yRow2 = yRow1 + 30; // text: "of 10" + const int yRow9 = gScreenHeight - 10; // "v1.14, Jan 22 2024" #define xButton 160 // indented column of buttons diff --git a/view.h b/view.h index 898de16..49c3f99 100644 --- a/view.h +++ b/view.h @@ -116,6 +116,25 @@ class View { tft->print(sName); } + void showProgressBar(int screen, int numScreens) { + // draw marker for advancing through settings, eg, 1 of 6, 2 of 6, etc. + int x0 = 74; // lhs bounding box + int y0 = 28; // top bounding box + int w = 320 - x0 - x0; // width of bounding box + int h = 10; // height bounding box + int c = cBUTTONOUTLINE; + + int wi = w / numScreens; // width of each item + for (int ii = 0; ii < numScreens; ii++) { + if (ii == (screen - 1)) { + // x, y, w, h, color + tft->fillRect(x0 + ii * wi, y0, wi, h, cFAINT); + } else { + tft->drawRect(x0 + ii * wi, y0, wi, h, cFAINTER); + } + } + } + /** * Rotate screen right-side-up / upside-down * 1=landscape, 3=landscape 180-degrees