Merge branch 'next' into kilrah/antennaselection

# Conflicts:
#	radio/src/translations/de.h.txt
#	radio/src/translations/es.h.txt
#	radio/src/translations/it.h.txt
#	radio/src/translations/pt.h.txt
#	radio/src/translations/se.h.txt
This commit is contained in:
Andre Bernet
2016-03-31 15:11:12 +04:00
163 changed files with 4166 additions and 5372 deletions
+1 -7
View File
@@ -256,7 +256,7 @@ void BitmapBuffer::drawFontPattern(coord_t x, coord_t y, const uint8_t * font, c
lcdNextPos = x + width;
}
void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags flags)
void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlags flags)
{
int width = getTextWidth(s, len, flags);
int height = getFontHeight(flags);
@@ -279,12 +279,6 @@ void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_
drawSolidFilledRect(x-INVERT_HORZ_MARGIN, y, width+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
}
char str[256];
if (flags & ZCHAR)
strcat_zchar(str, s, len);
else
strAppend(str, s, len);
const coord_t orig_x = x;
bool setx = false;
while (len--) {
+28
View File
@@ -52,6 +52,34 @@ const uint8_t LBM_TOPMENU_USB[] = {
#include "mask_topmenu_usb.lbm"
};
const uint8_t LBM_TOPMENU_VOLUME_0[] = {
#include "mask_volume_0.lbm"
};
const uint8_t LBM_TOPMENU_VOLUME_1[] = {
#include "mask_volume_1.lbm"
};
const uint8_t LBM_TOPMENU_VOLUME_2[] = {
#include "mask_volume_2.lbm"
};
const uint8_t LBM_TOPMENU_VOLUME_3[] = {
#include "mask_volume_3.lbm"
};
const uint8_t LBM_TOPMENU_VOLUME_4[] = {
#include "mask_volume_4.lbm"
};
const uint8_t LBM_TOPMENU_VOLUME_SCALE[] = {
#include "mask_volume_scale.lbm"
};
const uint8_t LBM_TOPMENU_TXBATT[] = {
#include "mask_txbat.lbm"
};
const uint8_t LBM_HTRIM_FRAME[] = {
#include "mask_htrim_frame.lbm"
};
+7
View File
@@ -30,6 +30,13 @@ extern const uint8_t LBM_CURRENT_DOT[];
// Main view icons
extern const uint8_t LBM_TOPMENU_USB[];
extern const uint8_t LBM_TOPMENU_VOLUME_0[];
extern const uint8_t LBM_TOPMENU_VOLUME_1[];
extern const uint8_t LBM_TOPMENU_VOLUME_2[];
extern const uint8_t LBM_TOPMENU_VOLUME_3[];
extern const uint8_t LBM_TOPMENU_VOLUME_4[];
extern const uint8_t LBM_TOPMENU_VOLUME_SCALE[];
extern const uint8_t LBM_TOPMENU_TXBATT[];
extern const uint8_t LBM_HTRIM_FRAME[];
extern const uint8_t LBM_VTRIM_FRAME[];
extern const uint8_t LBM_TRIM_SHADOW[];
+29 -21
View File
@@ -18,55 +18,63 @@
* GNU General Public License for more details.
*/
#include "../../opentx.h"
#include "opentx.h"
const uint16_t font_tinsize_specs[] PROGMEM =
uint16_t font_tinsize_specs[] = {
#include "font_tinsize.specs"
;
};
const pm_uchar font_tinsize[] PROGMEM = {
pm_uchar font_tinsize[] = {
#include "font_tinsize.lbm"
};
const uint16_t font_smlsize_specs[] PROGMEM =
uint16_t font_smlsize_specs[] = {
#include "font_smlsize.specs"
;
};
const pm_uchar font_smlsize[] PROGMEM = {
pm_uchar font_smlsize[] = {
#include "font_smlsize.lbm"
};
const uint16_t font_stdsize_specs[] PROGMEM =
uint16_t font_stdsize_specs[] = {
#include "font_stdsize.specs"
;
};
const pm_uchar font_stdsize[] PROGMEM = {
pm_uchar font_stdsize[] = {
#include "font_stdsize.lbm"
};
const uint16_t font_midsize_specs[] PROGMEM =
uint16_t font_midsize_specs[] = {
#include "font_midsize.specs"
;
};
const pm_uchar font_midsize[] PROGMEM = {
pm_uchar font_midsize[] = {
#include "font_midsize.lbm"
};
const uint16_t font_dblsize_specs[] PROGMEM =
uint16_t font_dblsize_specs[] = {
#include "font_dblsize.specs"
;
};
const pm_uchar font_dblsize[] PROGMEM = {
pm_uchar font_dblsize[] = {
#include "font_dblsize.lbm"
};
const uint16_t font_xxlsize_specs[] PROGMEM =
uint16_t font_xxlsize_specs[] = {
#include "font_xxlsize.specs"
;
};
const pm_uchar font_xxlsize[] PROGMEM = {
pm_uchar font_xxlsize[] = {
#include "font_xxlsize.lbm"
};
const uint16_t * const fontspecsTable[16] = { font_stdsize_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs };
const pm_uchar * const fontsTable[16] = { font_stdsize, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize };
uint16_t font_stdsizebold_specs[] = {
#include "font_stdsizebold.specs"
};
pm_uchar font_stdsizebold[] = {
#include "font_stdsizebold.lbm"
};
const uint16_t * const fontspecsTable[16] = { font_stdsize_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs, font_stdsizebold_specs };
const uint8_t * const fontsTable[16] = { font_stdsize, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize, font_stdsizebold };
+2 -2
View File
@@ -51,10 +51,10 @@
#define CURVE_COORD_WIDTH 36
#define CURVE_COORD_HEIGHT 17
#define DATETIME_SEPARATOR_X (LCD_W-55)
#define DATETIME_SEPARATOR_X (LCD_W-53)
#define DATETIME_LINE1 9
#define DATETIME_LINE2 23
#define DATETIME_MIDDLE (LCD_W+DATETIME_SEPARATOR_X+8)/2
#define DATETIME_MIDDLE (LCD_W+DATETIME_SEPARATOR_X+6)/2
#define MENU_TITLE_NEXT_POS (lcdNextPos + 10)
#define MENU_INIT_VPOS -1
+1 -1
View File
@@ -38,7 +38,6 @@
#define lcdint_t int32_t
#define BSS 0x00
#define BOLD 0x00
/* lcd common flags */
#define BLINK 0x01
@@ -69,6 +68,7 @@
#define MIDSIZE 0x0300
#define DBLSIZE 0x0400
#define XXLSIZE 0x0500
#define BOLD 0x0600
#define VERTICAL 0x0800
#define TIMEBLINK 0x1000
+3 -3
View File
@@ -124,14 +124,14 @@ bool menuCommonCalib(evt_t event)
// START CALIBRATION
if (!READ_ONLY()) {
lcdDrawText(50, 3, STR_MENUCALIBRATION, MENU_TITLE_COLOR);
lcdDrawText(50, 3+FH, "Press [Enter] to start", MENU_TITLE_COLOR);
lcdDrawText(50, 3+FH, STR_MENUTOSTART, MENU_TITLE_COLOR);
}
break;
case CALIB_SET_MIDPOINT:
// SET MIDPOINT
lcdDrawText(50, 3, STR_MENUCALIBRATION, MENU_TITLE_COLOR);
lcdDrawText(50, 3+FH, "Please center sticks and press [Enter]", MENU_TITLE_COLOR);
lcdDrawText(50, 3+FH, STR_SETMIDPOINT, MENU_TITLE_COLOR);
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
reusableBuffer.calib.loVals[i] = 15000;
reusableBuffer.calib.hiVals[i] = -15000;
@@ -146,7 +146,7 @@ bool menuCommonCalib(evt_t event)
case CALIB_MOVE_STICKS:
// MOVE STICKS/POTS
lcdDrawText(50, 3, STR_MENUCALIBRATION, MENU_TITLE_COLOR);
lcdDrawText(50, 3+FH, "Move sticks, pots and sliders and press [Enter]", MENU_TITLE_COLOR);
lcdDrawText(50, 3+FH, STR_MOVESTICKSPOTS, MENU_TITLE_COLOR);
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {
g_eeGeneral.calib[i].mid = reusableBuffer.calib.midVals[i];
@@ -178,7 +178,7 @@ bool menuGeneralHardware(evt_t event)
#endif
case ITEM_SETUP_HW_BAT_CAL:
lcdDrawText(MENUS_MARGIN_LEFT, y, "Battery cal.");
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_BATT_CALIB);
lcdDrawNumber(HW_SETTINGS_COLUMN, y, getBatteryVoltage(), attr|LEFT|PREC2, 0, NULL, "V");
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.txVoltageCalibration, -127, 127);
break;
+1 -1
View File
@@ -18,7 +18,7 @@
* GNU General Public License for more details.
*/
#include "../../opentx.h"
#include "opentx.h"
bool menuGeneralVersion(evt_t event)
{
+2 -2
View File
@@ -250,7 +250,7 @@ bool menuModelCurveOne(evt_t event)
lcdDrawSolidFilledRect(point.x, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, 2, 2*CURVE_SIDE_WIDTH+2, CURVE_CURSOR_COLOR);
char text[5];
strAppendUnsigned(text, points[i]);
strAppendSigned(text, points[i]);
if (point.x >= CURVE_CENTER_X) {
drawCurveVerticalScale(point.x-15);
@@ -273,7 +273,7 @@ bool menuModelCurveOne(evt_t event)
drawCurvePoint(point.x-3, point.y-4, CURVE_CURSOR_COLOR);
strAppendUnsigned(text, x);
strAppendSigned(text, x);
drawCurveCoord(limit(CURVE_CENTER_X-CURVE_SIDE_WIDTH-1, point.x-CURVE_COORD_WIDTH/2, CURVE_CENTER_X+CURVE_SIDE_WIDTH-CURVE_COORD_WIDTH+1), CURVE_CENTER_Y+CURVE_SIDE_WIDTH+2, text, selectionMode==1);
if (s_editMode > 0) {
@@ -127,7 +127,7 @@ bool menuModelFlightModesAll(evt_t event)
FlightModeData *p = flightModeAddress(k);
putsFlightMode(MENUS_MARGIN_LEFT, y, k+1, (getFlightMode()==k ? 0/*BOLD*/ : 0) | ((sub==k && menuHorizontalPosition<0) ? INVERS : 0));
putsFlightMode(MENUS_MARGIN_LEFT, y, k+1, (getFlightMode()==k ? BOLD : 0) | ((sub==k && menuHorizontalPosition<0) ? INVERS : 0));
for (int j=0; j<ITEM_FLIGHT_MODES_COUNT; j++) {
LcdFlags attr = ((sub==k && posHorz==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
@@ -109,7 +109,7 @@ bool menuModelLogicalSwitches(evt_t event)
// CSW name
unsigned int sw = SWSRC_SW1+k;
putsSwitches(MENUS_MARGIN_LEFT, y, sw, (getSwitch(sw) ? 0/*BOLD*/ : 0) | ((sub==k && CURSOR_ON_LINE()) ? INVERS : 0));
putsSwitches(MENUS_MARGIN_LEFT, y, sw, (getSwitch(sw) ? BOLD : 0) | ((sub==k && CURSOR_ON_LINE()) ? INVERS : 0));
// CSW func
lcdDrawTextAtIndex(CSW_1ST_COLUMN, y, STR_VCSWFUNC, cs->func, horz==0 ? attr : 0);
+1 -1
View File
@@ -162,7 +162,7 @@ enum MixFields {
MIX_FIELD_COUNT
};
void gvarWeightItem(coord_t x, coord_t y, MixData *md, uint8_t attr, evt_t event)
void gvarWeightItem(coord_t x, coord_t y, MixData *md, LcdFlags attr, evt_t event)
{
u_int8int16_t weight;
MD_WEIGHT_TO_UNION(md, weight);
+2 -2
View File
@@ -101,11 +101,11 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, evt_t event)
{
TimerData * timer = &g_model.timers[timerIdx];
if (attr && menuHorizontalPosition < 0) {
lcdDrawSolidFilledRect(MODEL_SETUP_2ND_COLUMN-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN+1, 90+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
lcdDrawSolidFilledRect(MODEL_SETUP_2ND_COLUMN-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN+1, 115+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
}
drawStringWithIndex(MENUS_MARGIN_LEFT, y, STR_TIMER, timerIdx+1);
putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, (menuHorizontalPosition<=0 ? attr : 0));
putsTimer(MODEL_SETUP_2ND_COLUMN+50, y, timer->start, (menuHorizontalPosition!=0 ? attr : 0));
putsTimer(MODEL_SETUP_2ND_COLUMN+50, y, timer->start, (menuHorizontalPosition==1 ? attr|TIMEHOUR : TIMEHOUR));
if (attr && s_editMode>0) {
switch (menuHorizontalPosition) {
case 0:
+27 -30
View File
@@ -487,18 +487,21 @@ bool menuScreenSetup(int index, evt_t event)
currentContainer = currentScreen;
bool needsOffsetCheck = (menuVerticalPosition != 0 || menuHorizontalPosition < 0);
const ZoneOption * options = currentScreen->getFactory()->getOptions();
int optionsCount = getOptionsCount(options);
linesCount = ITEM_SCREEN_SETUP_LAYOUT_OPTION1 + optionsCount;
char title[] = "Main view X";
title[sizeof(title)-2] = '1' + index;
menuPageCount = updateMainviewsMenu();
uint8_t mstate_tab[2 + MAX_LAYOUT_OPTIONS] = { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW };
const ZoneOption * options = currentScreen->getFactory()->getOptions();
int optionsCount = getOptionsCount(options);
linesCount = ITEM_SCREEN_SETUP_LAYOUT_OPTION1 + optionsCount;
if (menuPageCount > 3)
++linesCount;
uint8_t mstate_tab[2 + MAX_LAYOUT_OPTIONS + 1] = { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW };
for (int i=0; i<optionsCount; i++) {
mstate_tab[3+i] = getZoneOptionColumns(&options[i]);
}
mstate_tab[3+optionsCount] = 0; // The remove button
CUSTOM_MENU_WITH_OPTIONS(title, LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, index+1, linesCount);
@@ -533,26 +536,33 @@ bool menuScreenSetup(int index, evt_t event)
default:
{
uint8_t index = k - ITEM_SCREEN_SETUP_LAYOUT_OPTION1;
if (index < optionsCount) {
const ZoneOption * option = &options[index];
ZoneOptionValue * value = currentScreen->getOptionValue(index);
uint8_t o = k - ITEM_SCREEN_SETUP_LAYOUT_OPTION1;
if (o < optionsCount) {
const ZoneOption * option = &options[o];
ZoneOptionValue * value = currentScreen->getOptionValue(o);
if (editZoneOption(y, option, value, attr, EE_MODEL, event)) {
currentScreen->update();
}
}
else if (menuPageCount > 3 && o == optionsCount) {
drawButton(SCREENS_SETUP_2ND_COLUMN, y, STR_REMOVE_SCREEN, attr);
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
delete currentScreen;
if (index != MAX_CUSTOM_SCREENS-1) {
memmove(&g_model.screenData[index], &g_model.screenData[index + 1], sizeof(CustomScreenData) * (MAX_CUSTOM_SCREENS - index - 1));
memmove(&customScreens[index], &customScreens[index + 1], sizeof(Layout *) * (MAX_CUSTOM_SCREENS - index - 1));
}
memset(&g_model.screenData[MAX_CUSTOM_SCREENS-1], 0, sizeof(CustomScreenData));
customScreens[MAX_CUSTOM_SCREENS-1] = NULL;
chainMenu(menuTabScreensSetup[index > 0 ? index : 1]);
return false;
}
}
break;
}
}
}
if (menuVerticalPosition == -1 && index > 0 && event == EVT_KEY_LONG(KEY_ENTER)) {
killEvents(KEY_ENTER);
menuHorizontalPosition = index;
POPUP_MENU_ADD_ITEM(STR_REMOVE_SCREEN);
popupMenuHandler = onScreenSetupMenu;
}
return true;
}
@@ -592,23 +602,10 @@ bool menuScreenAdd(evt_t event)
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
customScreens[menuPageCount-2] = registeredLayouts[0]->create(&g_model.screenData[menuPageCount-2].layoutData);
s_editMode = 0;
menuHorizontalPosition = -1;
return false;
}
SIMPLE_MENU_WITH_OPTIONS("Add main view", LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, menuPageCount-1, 0);
return true;
}
void onScreenSetupMenu(const char * result)
{
if (result == STR_REMOVE_SCREEN) {
delete customScreens[menuHorizontalPosition];
if (menuHorizontalPosition != MAX_CUSTOM_SCREENS-1) {
memmove(&g_model.screenData[menuHorizontalPosition], &g_model.screenData[menuHorizontalPosition + 1], sizeof(CustomScreenData) * (MAX_CUSTOM_SCREENS - menuHorizontalPosition - 1));
memmove(&customScreens[menuHorizontalPosition], &customScreens[menuHorizontalPosition + 1], sizeof(Layout *) * (MAX_CUSTOM_SCREENS - menuHorizontalPosition - 1));
}
memset(&g_model.screenData[MAX_CUSTOM_SCREENS-1], 0, sizeof(CustomScreenData));
customScreens[MAX_CUSTOM_SCREENS-1] = NULL;
// chainMenu(menuMainviews[menuHorizontalPosition > 0 ? menuHorizontalPosition-1 : 0]);
}
}
+22 -2
View File
@@ -28,7 +28,7 @@ unsigned int Topbar::getZonesCount() const
Zone Topbar::getZone(unsigned int index) const
{
Zone zone;
zone.x = 50 + (TOPBAR_ZONE_WIDTH + 2*TOPBAR_ZONE_MARGIN) * index;
zone.x = 49 + (TOPBAR_ZONE_WIDTH + 2*TOPBAR_ZONE_MARGIN) * index;
zone.y = TOPBAR_ZONE_MARGIN;
zone.w = TOPBAR_ZONE_WIDTH;
zone.h = MENU_HEADER_HEIGHT - 2*TOPBAR_ZONE_MARGIN;
@@ -57,7 +57,7 @@ void drawTopBar()
// USB icon
if (usbPlugged()) {
lcdDrawBitmapPattern(LCD_W-102, 8, LBM_TOPMENU_USB, MENU_TITLE_COLOR);
lcdDrawBitmapPattern(LCD_W-98, 8, LBM_TOPMENU_USB, MENU_TITLE_COLOR);
}
// RSSI
@@ -68,6 +68,26 @@ void drawTopBar()
lcdDrawSolidFilledRect(LCD_W-90 + i * 6, 38 - height, 4, height, TELEMETRY_RSSI() >= rssiBarsValue[i] ? MENU_TITLE_COLOR : MENU_TITLE_DISABLE_COLOR);
}
/* Audio volume */
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_SCALE, MENU_TITLE_DISABLE_COLOR);
if (requiredSpeakerVolume == 0 || g_eeGeneral.beepMode == e_mode_quiet)
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_0, MENU_TITLE_COLOR);
else if (requiredSpeakerVolume < 7)
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_1, MENU_TITLE_COLOR);
else if (requiredSpeakerVolume < 13)
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_2, MENU_TITLE_COLOR);
else if (requiredSpeakerVolume < 19)
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_3, MENU_TITLE_COLOR);
else
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_4, MENU_TITLE_COLOR);
/* Tx battery */
uint8_t bars = limit<int8_t>(0, 6 * (g_vbat100mV - g_eeGeneral.vBatMin - 90) / (30 + g_eeGeneral.vBatMax - g_eeGeneral.vBatMin), 5);
lcdDrawBitmapPattern(LCD_W-130, 24, LBM_TOPMENU_TXBATT, MENU_TITLE_COLOR);
for (unsigned int i = 0; i < 5; i++) {
lcdDrawSolidFilledRect(LCD_W-122+4*i, 30, 2, 8, i >= bars ? MENU_TITLE_DISABLE_COLOR : MENU_TITLE_COLOR);
}
topbar->refresh();
#if 0
+1 -1
View File
@@ -25,7 +25,7 @@
#define MAX_TOPBAR_ZONES 5
#define MAX_TOPBAR_OPTIONS 0
#define TOPBAR_ZONE_WIDTH 60
#define TOPBAR_ZONE_WIDTH 70
#define TOPBAR_ZONE_MARGIN 3
class Topbar: public WidgetsContainer<MAX_TOPBAR_ZONES, MAX_TOPBAR_OPTIONS>
+3 -7
View File
@@ -137,10 +137,6 @@ bool menuMainView(evt_t event)
killEvents(KEY_DOWN);
break;
case EVT_ENTRY_UP:
LOAD_MODEL_BITMAP();
break;
case EVT_KEY_LONG(KEY_ENTER):
killEvents(event);
POPUP_MENU_ADD_ITEM(STR_MODEL_SELECT);
@@ -157,17 +153,17 @@ bool menuMainView(evt_t event)
case EVT_KEY_LONG(KEY_MODEL):
killEvents(event);
pushMenu(menuTabModel[0]);
break;
return false;
case EVT_KEY_LONG(KEY_RADIO):
killEvents(event);
pushMenu(menuTabGeneral[0]);
break;
return false;
case EVT_KEY_LONG(KEY_TELEM):
killEvents(event);
pushMenu(menuTabScreensSetup[1]);
break;
return false;
case EVT_KEY_BREAK(KEY_PGDN):
storageDirty(EE_GENERAL);
+15 -7
View File
@@ -45,8 +45,13 @@ void TimerWidget::refresh()
TimerState & timerState = timersStates[index];
if (zone.w >= 180 && zone.h >= 70) {
lcdDrawBitmapPattern(zone.x, zone.y, LBM_TIMER_BACKGROUND, MAINVIEW_PANES_COLOR);
if (timerData.start) {
if (timerState.val >= 0 || !(timerState.val % 2)) {
lcdDrawBitmapPattern(zone.x, zone.y, LBM_TIMER_BACKGROUND, MAINVIEW_PANES_COLOR);
}
else {
lcdDrawBitmapPattern(zone.x, zone.y, LBM_TIMER_BACKGROUND, HEADER_BGCOLOR);
}
if (timerData.start && timerState.val >= 0) {
lcdDrawBitmapPatternPie(
zone.x + 2,
zone.y + 3, LBM_RSCALE, MAINVIEW_GRAPHICS_COLOR, 0,
@@ -67,21 +72,24 @@ void TimerWidget::refresh()
drawStringWithIndex(zone.x + 137, zone.y + 17, "TMR", index + 1, SMLSIZE | TEXT_COLOR);
}
else {
drawStringWithIndex(zone.x, zone.y, "TMR", index + 1, SMLSIZE | TEXT_INVERTED_COLOR);
if (timerState.val < 0 && timerState.val % 2) {
lcdDrawSolidFilledRect(zone.x, zone.y, zone.w, zone.h, HEADER_ICON_BGCOLOR);
}
drawStringWithIndex(zone.x + 2, zone.y, "TMR", index + 1, SMLSIZE | TEXT_INVERTED_COLOR);
if (zone.w > 100 && zone.h > 40) {
if (abs(timerState.val) >= 3600) {
putsTimer(zone.x, zone.y + 16, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | TIMEHOUR);
putsTimer(zone.x + 3, zone.y + 16, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | TIMEHOUR);
}
else {
putsTimer(zone.x, zone.y + 16, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | MIDSIZE);
putsTimer(zone.x + 3, zone.y + 16, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | MIDSIZE);
}
}
else {
if (abs(timerState.val) >= 3600) {
putsTimer(zone.x, zone.y + 14, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | SMLSIZE | TIMEHOUR);
putsTimer(zone.x + 3, zone.y + 14, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | SMLSIZE | TIMEHOUR);
}
else {
putsTimer(zone.x, zone.y + 14, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT);
putsTimer(zone.x + 3, zone.y + 14, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT);
}
}
}