mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
Progress circle in all menus
This commit is contained in:
parent
ab5de66405
commit
c38cb2e0ff
5 changed files with 9 additions and 9 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue