1. Included mroe fonts

2. change order of initialization.  Lvgl has to be before ViewMain
3. Basic support for layers, but they are still broken when Menu's are used
4. Register input driver in lvglwrapper
This commit is contained in:
kkoenig1@optonline.com
2022-06-11 15:38:08 +02:00
committed by Raphael Coeffic
parent fd3d6c902c
commit fd276bb2fc
9 changed files with 13 additions and 14 deletions
+2 -3
View File
@@ -27,7 +27,6 @@ LvglWrapper* LvglWrapper::_instance = nullptr;
static lv_disp_drv_t disp_drv; /*A variable to hold the drivers. Must be static or global.*/
lv_disp_t * disp;
static lv_disp_draw_buf_t disp_buf;
static lv_indev_drv_t indev_drv;
@@ -268,14 +267,14 @@ LvglWrapper::LvglWrapper()
disp_drv.sw_rotate = 1;
lv_indev_drv_init(&indev_drv); /*Basic initialization*/
indev_drv.type =LV_INDEV_TYPE_POINTER; /*See below.*/
indev_drv.type = LV_INDEV_TYPE_POINTER; /*See below.*/
indev_drv.read_cb = my_input_read; /*See below.*/
/*Register the driver in LVGL and save the created input device object*/
disp = lv_disp_drv_register(&disp_drv); /*Register the driver and save the created display objects*/
lv_example_canvas_2();
lv_indev_t * my_indev = lv_indev_drv_register(&indev_drv);
#if 0
/*lv_indev_t * my_indev = */lv_indev_drv_register(&indev_drv);
+1 -1
View File
@@ -28,7 +28,7 @@
FullScreenDialog::FullScreenDialog(
uint8_t type, std::string title, std::string message, std::string action,
const std::function<void(void)>& confirmHandler) :
FormGroup(MainWindow::instance(), {0, 0, LCD_W, LCD_H}, OPAQUE),
FormGroup(MainWindow::instance(), {0, 0, LCD_W, LCD_H}, OPAQUE, true),
type(type),
title(std::move(title)),
message(std::move(message)),
+1 -1
View File
@@ -45,7 +45,7 @@ void PageHeader::paint(BitmapBuffer * dc)
}
Page::Page(unsigned icon):
Window(MainWindow::instance(), {0, 0, LCD_W, LCD_H}, OPAQUE),
Window(MainWindow::instance(), {0, 0, LCD_W, LCD_H}, OPAQUE, true),
header(this, icon),
body(this, { 0, MENU_HEADER_HEIGHT, LCD_W, LCD_H - MENU_HEADER_HEIGHT }, FORM_FORWARD_FOCUS)
{
+1 -1
View File
@@ -161,7 +161,7 @@ class SetupWidgetsPage: public FormWindow
{
public:
SetupWidgetsPage(ScreenMenu* menu, uint8_t customScreenIdx):
FormWindow(ViewMain::instance(), {0, 0, 0, 0}, FORM_FORWARD_FOCUS),
FormWindow(ViewMain::instance(), {0, 0, 0, 0}, FORM_FORWARD_FOCUS,true),
menu(menu),
customScreenIdx(customScreenIdx)
{
+1 -1
View File
@@ -34,7 +34,7 @@ Topbar * TopbarFactory::create(Window * parent)
}
SetupTopBarWidgetsPage::SetupTopBarWidgetsPage(ScreenMenu* menu):
FormWindow(ViewMain::instance(), {0, 0, 0, 0}, FORM_FORWARD_FOCUS),
FormWindow(ViewMain::instance(), {0, 0, 0, 0}, FORM_FORWARD_FOCUS, true),
menu(menu)
{
// remember focus
+1 -1
View File
@@ -34,7 +34,7 @@
#include "view_text.h"
ViewMainMenu::ViewMainMenu(Window* parent) :
Window(parent->getFullScreenWindow(), {})
Window(parent->getFullScreenWindow(), {}, 0, 0, true)
{
// Save focus
Layer::push(this);
+4 -4
View File
@@ -310,11 +310,11 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
/*Montserrat fonts with ASCII range and some symbols using bpp = 4
*https://fonts.google.com/specimen/Montserrat*/
#define LV_FONT_MONTSERRAT_8 0
#define LV_FONT_MONTSERRAT_10 0
#define LV_FONT_MONTSERRAT_12 0
#define LV_FONT_MONTSERRAT_8 1
#define LV_FONT_MONTSERRAT_10 1
#define LV_FONT_MONTSERRAT_12 1
#define LV_FONT_MONTSERRAT_14 1
#define LV_FONT_MONTSERRAT_16 0
#define LV_FONT_MONTSERRAT_16 1
#define LV_FONT_MONTSERRAT_18 0
#define LV_FONT_MONTSERRAT_20 0
#define LV_FONT_MONTSERRAT_22 0
+1 -1
View File
@@ -1770,8 +1770,8 @@ void opentxInit()
TRACE("opentxInit");
#if defined(LIBOPENUI)
// create ViewMain
ViewMain::instance();
LvglWrapper::instance();
ViewMain::instance();
#elif defined(GUI)
// TODO add a function for this (duplicated)
menuHandlers[0] = menuMainView;