diff --git a/radio/src/gui/colorlcd/layouts/layout1+2.cpp b/radio/src/gui/colorlcd/layouts/layout1+2.cpp index 309156c99..df968e6fd 100644 --- a/radio/src/gui/colorlcd/layouts/layout1+2.cpp +++ b/radio/src/gui/colorlcd/layouts/layout1+2.cpp @@ -1,7 +1,8 @@ /* - * Copyright (C) OpenTX + * Copyright (C) EdgeTX * * Based on code named + * opentx - https://github.com/opentx/opentx * th9x - http://code.google.com/p/th9x * er9x - http://code.google.com/p/er9x * gruvin9x - http://code.google.com/p/gruvin9x diff --git a/radio/src/gui/colorlcd/layouts/layout1x2.cpp b/radio/src/gui/colorlcd/layouts/layout1x2.cpp index 14f1dd265..6c3c728a6 100644 --- a/radio/src/gui/colorlcd/layouts/layout1x2.cpp +++ b/radio/src/gui/colorlcd/layouts/layout1x2.cpp @@ -1,7 +1,8 @@ /* - * Copyright (C) OpenTX + * Copyright (C) EdgeTX * * Based on code named + * opentx - https://github.com/opentx/opentx * th9x - http://code.google.com/p/th9x * er9x - http://code.google.com/p/er9x * gruvin9x - http://code.google.com/p/gruvin9x diff --git a/radio/src/gui/colorlcd/layouts/layout1x4.cpp b/radio/src/gui/colorlcd/layouts/layout1x4.cpp new file mode 100644 index 000000000..c9eec4faa --- /dev/null +++ b/radio/src/gui/colorlcd/layouts/layout1x4.cpp @@ -0,0 +1,61 @@ +/* + * Copyright (C) EdgeTX + * + * Based on code named + * opentx - https://github.com/opentx/opentx + * 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_1x4[] = { +#include "mask_layout1x4.lbm" +}; + +const ZoneOption OPTIONS_LAYOUT_1x4[] = { + LAYOUT_COMMON_OPTIONS, + LAYOUT_OPTIONS_END +}; + +class Layout1x4: public Layout +{ + public: + Layout1x4(const LayoutFactory * factory, Layout::PersistentData * persistentData): + Layout(factory, persistentData) + { + } + + unsigned int getZonesCount() const override + { + return 4; + } + + rect_t getZone(unsigned int index) const override + { + rect_t zone = getMainZone(); + + if (index > 3) + { + index = 3; + } + return {zone.x, zone.y + zone.h / 4 * index, zone.w, zone.h / 4}; + + return zone; + } +}; + +BaseLayoutFactory Layout1x4("Layout1x4", "1 x 4", LBM_LAYOUT_1x4, OPTIONS_LAYOUT_1x4);