[Horus] UI continued
This commit is contained in:
@@ -30,6 +30,7 @@ class Layout1x1: public Layout
|
||||
|
||||
virtual void create()
|
||||
{
|
||||
Layout::create();
|
||||
persistentData->options[0].boolValue = true;
|
||||
persistentData->options[1].boolValue = true;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ class Layout2P1: public Layout
|
||||
|
||||
virtual void create()
|
||||
{
|
||||
Layout::create();
|
||||
persistentData->options[0].boolValue = true;
|
||||
persistentData->options[1].boolValue = true;
|
||||
persistentData->options[2].boolValue = true;
|
||||
@@ -56,8 +57,8 @@ class Layout2P1: public Layout
|
||||
|
||||
const Zone Layout2P1::zones[3] = {
|
||||
{ 240, 60, 192, 145 },
|
||||
{ 46, 60, 192, 70 },
|
||||
{ 46, 135, 192, 70 }
|
||||
{ 46, 60, 182, 66 },
|
||||
{ 46, 139, 182, 66 }
|
||||
};
|
||||
|
||||
const ZoneOption Layout2P1::options[] = {
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* 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"
|
||||
|
||||
class Layout2x1: public Layout
|
||||
{
|
||||
public:
|
||||
Layout2x1(const LayoutFactory * factory, Layout::PersistentData * persistentData):
|
||||
Layout(factory, persistentData)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void create()
|
||||
{
|
||||
Layout::create();
|
||||
persistentData->options[0].boolValue = true;
|
||||
}
|
||||
|
||||
virtual unsigned int getZonesCount() const
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
virtual Zone getZone(unsigned int index) const
|
||||
{
|
||||
Zone zone;
|
||||
zone.w = (LCD_W-3*10) / 2;
|
||||
zone.x = (index & 1) ? 20 + zone.w : 10;
|
||||
if (persistentData->options[0].boolValue) {
|
||||
zone.h = (LCD_H-MENU_HEADER_HEIGHT-2*10);
|
||||
zone.y = MENU_HEADER_HEIGHT + 10;
|
||||
}
|
||||
else {
|
||||
zone.h = (LCD_H-2*10);
|
||||
zone.y = 10;
|
||||
}
|
||||
return zone;
|
||||
}
|
||||
|
||||
virtual void refresh(bool setup=false);
|
||||
|
||||
static const ZoneOption options[];
|
||||
|
||||
};
|
||||
|
||||
const ZoneOption Layout2x1::options[] = {
|
||||
{ "Top bar", ZoneOption::Bool },
|
||||
{ NULL, ZoneOption::Bool }
|
||||
};
|
||||
|
||||
void Layout2x1::refresh(bool setup)
|
||||
{
|
||||
theme->drawBackground();
|
||||
|
||||
if (persistentData->options[0].boolValue) {
|
||||
// Top Bar
|
||||
drawMainViewTopBar();
|
||||
}
|
||||
|
||||
Layout::refresh(setup);
|
||||
}
|
||||
|
||||
const uint8_t LBM_LAYOUT_2x1[] __DMA = {
|
||||
#include "mask_layout2x1.lbm"
|
||||
};
|
||||
|
||||
BaseLayoutFactory<Layout2x1> Layout2x1("Layout2x1", LBM_LAYOUT_2x1, Layout2x1::options);
|
||||
@@ -30,6 +30,7 @@ class Layout2x2: public Layout
|
||||
|
||||
virtual void create()
|
||||
{
|
||||
Layout::create();
|
||||
persistentData->options[0].boolValue = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ class Layout2x4: public Layout
|
||||
|
||||
virtual void create()
|
||||
{
|
||||
Layout::create();
|
||||
persistentData->options[0].boolValue = true;
|
||||
persistentData->options[1].boolValue = true;
|
||||
persistentData->options[2].boolValue = true;
|
||||
@@ -49,9 +50,9 @@ class Layout2x4: public Layout
|
||||
{
|
||||
Zone zone;
|
||||
zone.x = (index >= 4) ? 260 : 60;
|
||||
zone.y = 55 + (index % 4) * 40;
|
||||
zone.y = 56 + (index % 4) * 42;
|
||||
zone.w = 160;
|
||||
zone.h = 40;
|
||||
zone.h = 32;
|
||||
return zone;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 178 B |
Reference in New Issue
Block a user