From c38cb2e0ff246983946319239fcb614d1548fc50 Mon Sep 17 00:00:00 2001 From: bsongis Date: Sat, 26 Nov 2011 22:30:00 +0000 Subject: [PATCH] Progress circle in all menus --- src/file.cpp | 8 ++++---- src/file.h | 2 +- src/main_views.cpp | 2 +- src/menus.cpp | 2 +- src/model_menus.cpp | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/file.cpp b/src/file.cpp index befa73967..b1d38611a 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -573,7 +573,7 @@ void RlcFile::flush() } #define PROGRESS_CIRCLE -void RlcFile::DisplayProgressBar() +void RlcFile::DisplayProgressBar(uint8_t x) { if (s_eeDirtyMsk || m_rlc_len || eeprom_buffer_size) { #if defined (PROGRESS_BAR) @@ -581,14 +581,14 @@ void RlcFile::DisplayProgressBar() lcd_filled_rect(2, 1, 125, 5, WHITE); lcd_filled_rect(3, 2, 123-len, 3); #elif defined (PROGRESS_CIRCLE) + lcd_filled_rect(x-1, 0, 7, 7, WHITE); uint8_t len = 200 - (s_eeDirtyMsk ? 200 : min((uint8_t)200, (uint8_t)((m_rlc_len / 4) + (eeprom_buffer_size / 3)))); - uint8_t x = 17*FW-3; - lcd_hline(x+1, 1, len >= 50 ? 3 : len / 16); + lcd_hline(x+1, 1, len >= 50 ? 3 : len / 14); if (len >= 50) lcd_vline(x+4, 2, len >= 100 ? 3 : (len-50) / 17); if (len >= 100) lcd_hline(x+4, 1+4, len >= 150 ? -3 : -((len-100) / 17)); if (len >= 150) lcd_vline(x, 5, -((len-133) / 17)); #elif defined (PROGRESS_FIXED_CIRCLE) - lcd_square(17*FW-3, 1, 5); + lcd_square(x, 1, 5); #endif } } diff --git a/src/file.h b/src/file.h index aab72b7dd..010812436 100644 --- a/src/file.h +++ b/src/file.h @@ -143,7 +143,7 @@ public: uint16_t readRlc(uint8_t*buf, uint16_t i_len); // TODO should be like writeRlc? #endif - void DisplayProgressBar(); + void DisplayProgressBar(uint8_t x); }; #endif diff --git a/src/main_views.cpp b/src/main_views.cpp index 6e854ba8c..c730e63bc 100644 --- a/src/main_views.cpp +++ b/src/main_views.cpp @@ -535,5 +535,5 @@ void menuMainView(uint8_t event) putsTime(33+FW+2, FH*5, timer2, DBLSIZE, DBLSIZE); } - // TODO here it's too intrusive: theFile.DisplayProgressBar(); + theFile.DisplayProgressBar(20*FW+1); } diff --git a/src/menus.cpp b/src/menus.cpp index 812208f5b..2fc9d2fa1 100644 --- a/src/menus.cpp +++ b/src/menus.cpp @@ -185,7 +185,7 @@ bool check(uint8_t event, uint8_t curr, MenuFuncP *menuTab, uint8_t menuTabSize, DisplayScreenIndex(curr, menuTabSize, attr); } - theFile.DisplayProgressBar(); + theFile.DisplayProgressBar(menuTab ? lcd_lastPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1); uint8_t maxcol = MAXCOL(m_posVert); switch(event) diff --git a/src/model_menus.cpp b/src/model_menus.cpp index 83278203e..e3abd9477 100644 --- a/src/model_menus.cpp +++ b/src/model_menus.cpp @@ -745,7 +745,7 @@ void menuProcCurveOne(uint8_t event) TITLE("CURVE"); lcd_outdezAtt(5*FW+1, 0, s_curveChan+1, INVERS|LEFT); - theFile.DisplayProgressBar(); + theFile.DisplayProgressBar(20*FW+1); if (s_curveChan >= MAX_CURVE5) { points = 9; @@ -1658,7 +1658,7 @@ void menuProcCustomSwitches(uint8_t event) void menuProcFunctionSwitches(uint8_t event) { - MENU("FUNCTION SWITCHES", menuTabModel, e_FunctionSwitches, NUM_FSW+1, {0, 1/*repeated*/}); + MENU("FUNC SWITCHES", menuTabModel, e_FunctionSwitches, NUM_FSW+1, {0, 1/*repeated*/}); uint8_t y = 0; uint8_t k = 0;