From 52f4714e4c08e50c04ae2c865a0945d21d2f87da Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Tue, 24 Aug 2021 15:47:39 +1000 Subject: [PATCH] Implement 1x3 layout --- radio/src/gui/colorlcd/layouts/layout1x3.cpp | 58 ++++++++++++++++++ .../gui/colorlcd/layouts/mask_layout1x3.png | Bin 0 -> 182 bytes 2 files changed, 58 insertions(+) create mode 100644 radio/src/gui/colorlcd/layouts/layout1x3.cpp create mode 100644 radio/src/gui/colorlcd/layouts/mask_layout1x3.png diff --git a/radio/src/gui/colorlcd/layouts/layout1x3.cpp b/radio/src/gui/colorlcd/layouts/layout1x3.cpp new file mode 100644 index 000000000..140dcb4b4 --- /dev/null +++ b/radio/src/gui/colorlcd/layouts/layout1x3.cpp @@ -0,0 +1,58 @@ +/* + * 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_1x3[] = { +#include "mask_layout1x3.lbm" +}; + +const ZoneOption OPTIONS_LAYOUT_1x3[] = { + LAYOUT_COMMON_OPTIONS, + LAYOUT_OPTIONS_END +}; + +class Layout1x3: public Layout +{ + public: + Layout1x3(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(); + + zone.h /= 3; + zone.y += zone.h * index; + + return zone; + } +}; + +BaseLayoutFactory Layout1x3("Layout1x3", "1 x 3", LBM_LAYOUT_1x3, OPTIONS_LAYOUT_1x3); diff --git a/radio/src/gui/colorlcd/layouts/mask_layout1x3.png b/radio/src/gui/colorlcd/layouts/mask_layout1x3.png new file mode 100644 index 0000000000000000000000000000000000000000..2405442038bb2f541c8af5dca99a907111e177ff GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^#y~8|!3HGfOcSdDQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@i-DT2f-s})wTO>EL2pkN$B+p3w^t8xGAQt{9PIx4ea#}Vjcu|5 zXNu#)J)hO-&YAHxPJZ>Op6~ewCA5-PL>=8>?DCFhreVmjfSqub>8+V5jFW{0R1I%| Q9LT`n>FVdQ&MBb@0Gqfux&QzG literal 0 HcmV?d00001