diff --git a/radio/src/gui/480x272/layouts/layout1+2.cpp b/radio/src/gui/480x272/layouts/layout1+2.cpp deleted file mode 100644 index 39b483bc2..000000000 --- a/radio/src/gui/480x272/layouts/layout1+2.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "opentx.h" - -const uint8_t LBM_LAYOUT_1P2[] = { -#include "mask_layout1+2.lbm" -}; - -const ZoneOption OPTIONS_LAYOUT_1P2[] = { - { STR_TOP_BAR, ZoneOption::Bool }, - { STR_FLIGHT_MODE, ZoneOption::Bool }, - { STR_SLIDERS, ZoneOption::Bool }, - { STR_TRIMS, ZoneOption::Bool }, - { NULL, ZoneOption::Bool } -}; - -const Zone ZONES_LAYOUT_1P2[3] = { - - { 48, 60, 384, 70 }, - { 48, 142, 186, 70}, - { 246, 142, 186, 70} -}; - -class Layout1P2: public Layout -{ - public: - Layout1P2(const LayoutFactory * factory, Layout::PersistentData * persistentData): - Layout(factory, persistentData) - { - } - - virtual void create() - { - Layout::create(); - persistentData->options[0].boolValue = true; - persistentData->options[1].boolValue = true; - persistentData->options[2].boolValue = true; - persistentData->options[3].boolValue = true; - } - - virtual unsigned int getZonesCount() const - { - return DIM(ZONES_LAYOUT_1P2); - } - - virtual Zone getZone(unsigned int index) const - { - return ZONES_LAYOUT_1P2[index]; - } - - virtual void refresh(); -}; - -void Layout1P2::refresh() -{ - theme->drawBackground(); - - if (persistentData->options[0].boolValue) { - drawTopBar(); - } - - if (persistentData->options[1].boolValue) { - // Flight mode - lcdDrawSizedText(LCD_W / 2 - getTextWidth(g_model.flightModeData[mixerCurrentFlightMode].name, - sizeof(g_model.flightModeData[mixerCurrentFlightMode].name), - ZCHAR | SMLSIZE) / 2, - 232, - g_model.flightModeData[mixerCurrentFlightMode].name, - sizeof(g_model.flightModeData[mixerCurrentFlightMode].name), ZCHAR | SMLSIZE); - } - - if (persistentData->options[2].boolValue) { - // Pots and rear sliders positions - drawMainPots(); - } - - if (persistentData->options[3].boolValue) { - // Trims - drawTrims(mixerCurrentFlightMode); - } - - Layout::refresh(); -} - -BaseLayoutFactory layout1P2("Layout1P2", LBM_LAYOUT_1P2, OPTIONS_LAYOUT_1P2); - diff --git a/radio/src/gui/480x272/layouts/layout1+2i.cpp b/radio/src/gui/480x272/layouts/layout1+2i.cpp deleted file mode 100644 index 888fc5096..000000000 --- a/radio/src/gui/480x272/layouts/layout1+2i.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "opentx.h" - -const uint8_t LBM_LAYOUT_1P2i[] = { -#include "mask_layout1+2i.lbm" -}; - -const ZoneOption OPTIONS_LAYOUT_1P2i[] = { - { STR_TOP_BAR, ZoneOption::Bool }, - { STR_FLIGHT_MODE, ZoneOption::Bool }, - { STR_SLIDERS, ZoneOption::Bool }, - { STR_TRIMS, ZoneOption::Bool }, - { NULL, ZoneOption::Bool } -}; - -const Zone ZONES_LAYOUT_1P2i[3] = { - - { 48, 60, 186, 70}, - { 246, 60, 186, 70}, - { 48, 142, 384, 70 } - -}; - -class Layout1P2i: public Layout -{ - public: - Layout1P2i(const LayoutFactory * factory, Layout::PersistentData * persistentData): - Layout(factory, persistentData) - { - } - - virtual void create() - { - Layout::create(); - persistentData->options[0].boolValue = true; - persistentData->options[1].boolValue = true; - persistentData->options[2].boolValue = true; - persistentData->options[3].boolValue = true; - } - - virtual unsigned int getZonesCount() const - { - return DIM(ZONES_LAYOUT_1P2i); - } - - virtual Zone getZone(unsigned int index) const - { - return ZONES_LAYOUT_1P2i[index]; - } - - virtual void refresh(); -}; - -void Layout1P2i::refresh() -{ - theme->drawBackground(); - - if (persistentData->options[0].boolValue) { - drawTopBar(); - } - - if (persistentData->options[1].boolValue) { - // Flight mode - lcdDrawSizedText(LCD_W / 2 - getTextWidth(g_model.flightModeData[mixerCurrentFlightMode].name, - sizeof(g_model.flightModeData[mixerCurrentFlightMode].name), - ZCHAR | SMLSIZE) / 2, - 232, - g_model.flightModeData[mixerCurrentFlightMode].name, - sizeof(g_model.flightModeData[mixerCurrentFlightMode].name), ZCHAR | SMLSIZE); - } - - if (persistentData->options[2].boolValue) { - // Pots and rear sliders positions - drawMainPots(); - } - - if (persistentData->options[3].boolValue) { - // Trims - drawTrims(mixerCurrentFlightMode); - } - - Layout::refresh(); -} - -BaseLayoutFactory layout1P2i("Layout1P2i", LBM_LAYOUT_1P2i, OPTIONS_LAYOUT_1P2i); - diff --git a/radio/src/gui/480x272/layouts/layout5x0.cpp b/radio/src/gui/480x272/layouts/layout5x0.cpp new file mode 100644 index 000000000..74488aef6 --- /dev/null +++ b/radio/src/gui/480x272/layouts/layout5x0.cpp @@ -0,0 +1,74 @@ +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include "opentx.h" + +const uint8_t LBM_LAYOUT_5x0[] = { +#include "mask_layout5x0.lbm" +}; + +const ZoneOption OPTIONS_LAYOUT_5x0[] = { + { NULL, ZoneOption::Bool } +}; + +const Zone ZONES_LAYOUT_5x0[5] = { + /* X,Y,W,H */ + + { 10, 10, 84, 252 }, + { 104, 10, 272, 55 }, + { 104, 75, 272, 121 }, + { 104, 206, 272, 55}, + { 386, 10, 84, 252 } +}; + +class Layout5x0: public Layout +{ + public: + Layout5x0(const LayoutFactory * factory, Layout::PersistentData * persistentData): + Layout(factory, persistentData) + { + } + + virtual void create() + { + Layout::create(); + } + + virtual unsigned int getZonesCount() const + { + return DIM(ZONES_LAYOUT_5x0); + } + + virtual Zone getZone(unsigned int index) const + { + return ZONES_LAYOUT_5x0[index]; + } + + virtual void refresh(); +}; + +void Layout5x0::refresh() +{ + theme->drawBackground(); + Layout::refresh(); +} + +BaseLayoutFactory layout5x0("Layout5x0", LBM_LAYOUT_5x0, OPTIONS_LAYOUT_5x0); + diff --git a/radio/src/gui/480x272/layouts/mask_layout1+2i.png b/radio/src/gui/480x272/layouts/mask_layout1+2i.png deleted file mode 100644 index 5c23bbabe..000000000 Binary files a/radio/src/gui/480x272/layouts/mask_layout1+2i.png and /dev/null differ diff --git a/radio/src/gui/480x272/layouts/mask_layout1+2.png b/radio/src/gui/480x272/layouts/mask_layout5x0.png similarity index 64% rename from radio/src/gui/480x272/layouts/mask_layout1+2.png rename to radio/src/gui/480x272/layouts/mask_layout5x0.png index 78f39c1a5..8307da046 100644 Binary files a/radio/src/gui/480x272/layouts/mask_layout1+2.png and b/radio/src/gui/480x272/layouts/mask_layout5x0.png differ