Update to latest libopenui
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include "opentx.h"
|
||||
|
||||
FullScreenDialog::FullScreenDialog(uint8_t type, std::string title, std::string message, std::string action, const std::function<void(void)> & confirmHandler):
|
||||
FormGroup(&mainWindow, {0, 0, LCD_W, LCD_H}, OPAQUE),
|
||||
FormGroup(MainWindow::instance(), {0, 0, LCD_W, LCD_H}, OPAQUE),
|
||||
type(type),
|
||||
title(std::move(title)),
|
||||
message(std::move(message)),
|
||||
@@ -145,7 +145,7 @@ void FullScreenDialog::runForever()
|
||||
WDG_RESET();
|
||||
|
||||
RTOS_WAIT_MS(20);
|
||||
mainWindow.run(false);
|
||||
MainWindow::instance()->run(false);
|
||||
}
|
||||
|
||||
Window::deleteLater();
|
||||
|
||||
@@ -58,19 +58,19 @@
|
||||
|
||||
inline MessageDialog * createPopupInformation(const char * message)
|
||||
{
|
||||
return new MessageDialog(&mainWindow, "Message", message);
|
||||
return new MessageDialog(MainWindow::instance(), "Message", message);
|
||||
}
|
||||
|
||||
inline MessageDialog * createPopupWarning(const char * message)
|
||||
{
|
||||
return new MessageDialog(&mainWindow, "Warning", message);
|
||||
return new MessageDialog(MainWindow::instance(), "Warning", message);
|
||||
}
|
||||
|
||||
inline void POPUP_INFORMATION(const char * message)
|
||||
{
|
||||
auto popup = createPopupInformation(message);
|
||||
while (popup->getParent()) {
|
||||
mainWindow.run(false);
|
||||
MainWindow::instance()->run(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ inline void POPUP_WARNING(const char * message, const char * info = nullptr)
|
||||
popup->setInfoText(std::string(info));
|
||||
}
|
||||
while (popup->getParent()) {
|
||||
mainWindow.run(false);
|
||||
MainWindow::instance()->run(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ void PageHeader::paint(BitmapBuffer * dc)
|
||||
}
|
||||
|
||||
Page::Page(unsigned icon):
|
||||
Window(&mainWindow, {0, 0, LCD_W, LCD_H}, OPAQUE),
|
||||
Window(MainWindow::instance(), {0, 0, LCD_W, LCD_H}, OPAQUE),
|
||||
header(this, icon),
|
||||
body(this, { 0, MENU_HEADER_HEIGHT, LCD_W, LCD_H - MENU_HEADER_HEIGHT }, FORM_FORWARD_FOCUS)
|
||||
{
|
||||
|
||||
@@ -113,7 +113,7 @@ class FlashDialog: public FullScreenDialog
|
||||
device.flashFirmware(filename, [=](const char * title, const char * message, int count, int total) -> void {
|
||||
setMessage(message);
|
||||
progress.setValue(total > 0 ? count * 100 / total : 0);
|
||||
mainWindow.run(false);
|
||||
MainWindow::instance()->run(false);
|
||||
});
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ bool TabsCarousel::onTouchEnd(coord_t x, coord_t y)
|
||||
#endif
|
||||
|
||||
TabsGroup::TabsGroup(uint8_t icon):
|
||||
Window(&mainWindow, { 0, 0, LCD_W, LCD_H }, OPAQUE),
|
||||
Window(MainWindow::instance(), { 0, 0, LCD_W, LCD_H }, OPAQUE),
|
||||
header(this, icon),
|
||||
body(this, { 0, MENU_BODY_TOP, LCD_W, MENU_BODY_HEIGHT }, FORM_FORWARD_FOCUS)
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ int getMainViewsCount()
|
||||
ViewMain * ViewMain::instance = nullptr;
|
||||
|
||||
ViewMain::ViewMain(bool icons):
|
||||
FormWindow(&mainWindow, { 0, 0, LCD_W, LCD_H })
|
||||
FormWindow(MainWindow::instance(), { 0, 0, LCD_W, LCD_H })
|
||||
{
|
||||
instance = this;
|
||||
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@ void openUsbMenu()
|
||||
static Menu * menu = nullptr;
|
||||
if (menu)
|
||||
return;
|
||||
menu = new Menu(&mainWindow);
|
||||
menu = new Menu(MainWindow::instance());
|
||||
menu->setCloseHandler([]() {
|
||||
menu = nullptr;
|
||||
});
|
||||
@@ -329,7 +329,7 @@ void guiMain(event_t evt)
|
||||
bool screenshotRequested = (mainRequestFlags & (1u << REQUEST_SCREENSHOT));
|
||||
|
||||
#if defined(LIBOPENUI)
|
||||
mainWindow.run();
|
||||
MainWindow::instance()->run();
|
||||
#else
|
||||
if (!refreshNeeded) {
|
||||
DEBUG_TIMER_START(debugTimerMenus);
|
||||
|
||||
@@ -1902,6 +1902,7 @@ void opentxInit()
|
||||
TRACE("opentxInit");
|
||||
|
||||
#if defined(LIBOPENUI)
|
||||
new MainWindow();
|
||||
new ViewMain();
|
||||
#elif defined(GUI)
|
||||
// TODO add a function for this (duplicated)
|
||||
@@ -2260,7 +2261,7 @@ uint32_t pwrCheck()
|
||||
else {
|
||||
#if defined(COLORLCD)
|
||||
if (pwr_press_time != 0)
|
||||
mainWindow.invalidate();
|
||||
MainWindow::instance()->invalidate();
|
||||
#endif
|
||||
pwr_check_state = PWR_CHECK_ON;
|
||||
pwr_press_time = 0;
|
||||
|
||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: d7001e7687...f84ff26497
Reference in New Issue
Block a user