diff --git a/radio/src/gui/colorlcd/layouts/layout1+2.cpp b/radio/src/gui/colorlcd/layouts/layout1+2.cpp new file mode 100644 index 000000000..309156c99 --- /dev/null +++ b/radio/src/gui/colorlcd/layouts/layout1+2.cpp @@ -0,0 +1,65 @@ +/* + * 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 "layout.h" +#include "layout_factory_impl.h" + +const uint8_t LBM_LAYOUT_1P2[] = { +#include "mask_layout1+2.lbm" +}; + +const ZoneOption OPTIONS_LAYOUT_1P2[] = { + LAYOUT_COMMON_OPTIONS, + LAYOUT_OPTIONS_END +}; + +class Layout1P2: public Layout +{ + public: + Layout1P2(const LayoutFactory * factory, Layout::PersistentData * persistentData): + Layout(factory, persistentData) + { + } + + unsigned int getZonesCount() const override + { + return 3; + } + + rect_t getZone(unsigned int index) const override + { + rect_t zone = getMainZone(); + + if (index == 0) { + return {zone.x, zone.y, zone.w, zone.h / 2}; + } + else if (index == 1) { + return {zone.x, zone.y + zone.h / 2, zone.w, zone.h / 4}; + } + else + { + return {zone.x, zone.y + zone.h * 3 / 4, zone.w, zone.h / 4}; + } + + return zone; + } +}; + +BaseLayoutFactory Layout1P2("Layout1P2", "1 + 2", LBM_LAYOUT_1P2, OPTIONS_LAYOUT_1P2); diff --git a/radio/src/gui/colorlcd/layouts/layout1x2.cpp b/radio/src/gui/colorlcd/layouts/layout1x2.cpp new file mode 100644 index 000000000..14f1dd265 --- /dev/null +++ b/radio/src/gui/colorlcd/layouts/layout1x2.cpp @@ -0,0 +1,61 @@ +/* + * 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 "layout.h" +#include "layout_factory_impl.h" + +const uint8_t LBM_LAYOUT_1x2[] = { +#include "mask_layout1x2.lbm" +}; + +const ZoneOption OPTIONS_LAYOUT_1x2[] = { + LAYOUT_COMMON_OPTIONS, + LAYOUT_OPTIONS_END +}; + +class Layout1x2: public Layout +{ + public: + Layout1x2(const LayoutFactory * factory, Layout::PersistentData * persistentData): + Layout(factory, persistentData) + { + } + + unsigned int getZonesCount() const override + { + return 2; + } + + rect_t getZone(unsigned int index) const override + { + rect_t zone = getMainZone(); + + if (index == 0) { + return {zone.x, zone.y, zone.w, zone.h / 2}; + } + else { + return {zone.x, zone.y + zone.h / 2, zone.w, zone.h / 2}; + } + + return zone; + } +}; + +BaseLayoutFactory Layout1x2("Layout1x2", "1 x 2", LBM_LAYOUT_1x2, OPTIONS_LAYOUT_1x2); diff --git a/radio/src/gui/colorlcd/layouts/mask_layout1+2.png b/radio/src/gui/colorlcd/layouts/mask_layout1+2.png new file mode 100644 index 000000000..cef79bbbc Binary files /dev/null and b/radio/src/gui/colorlcd/layouts/mask_layout1+2.png differ diff --git a/radio/src/gui/colorlcd/layouts/mask_layout1x1.png b/radio/src/gui/colorlcd/layouts/mask_layout1x1.png index c575226dd..d80c5cf2c 100644 Binary files a/radio/src/gui/colorlcd/layouts/mask_layout1x1.png and b/radio/src/gui/colorlcd/layouts/mask_layout1x1.png differ diff --git a/radio/src/gui/colorlcd/layouts/mask_layout1x2.png b/radio/src/gui/colorlcd/layouts/mask_layout1x2.png new file mode 100644 index 000000000..2dd05cdfa Binary files /dev/null and b/radio/src/gui/colorlcd/layouts/mask_layout1x2.png differ diff --git a/radio/src/gui/colorlcd/layouts/mask_layout2+1.png b/radio/src/gui/colorlcd/layouts/mask_layout2+1.png index 9c9c7a1fe..d69083966 100644 Binary files a/radio/src/gui/colorlcd/layouts/mask_layout2+1.png and b/radio/src/gui/colorlcd/layouts/mask_layout2+1.png differ diff --git a/radio/src/gui/colorlcd/layouts/mask_layout2x1.png b/radio/src/gui/colorlcd/layouts/mask_layout2x1.png index 9bb74c18e..8f6aca64a 100644 Binary files a/radio/src/gui/colorlcd/layouts/mask_layout2x1.png and b/radio/src/gui/colorlcd/layouts/mask_layout2x1.png differ diff --git a/radio/src/gui/colorlcd/layouts/mask_layout2x2.png b/radio/src/gui/colorlcd/layouts/mask_layout2x2.png index bb958745b..3a481c579 100644 Binary files a/radio/src/gui/colorlcd/layouts/mask_layout2x2.png and b/radio/src/gui/colorlcd/layouts/mask_layout2x2.png differ