fix(color): widget layouts may not update correctly when flight mode changes (#6631)
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "layout_factory_impl.h"
|
||||
|
||||
#include "edgetx.h"
|
||||
#include "sliders.h"
|
||||
#include "trims.h"
|
||||
#include "view_main.h"
|
||||
@@ -94,5 +95,14 @@ rect_t Layout::getZone(unsigned int index) const
|
||||
return {z.x + xo, z.y + yo, w, h};
|
||||
}
|
||||
|
||||
void Layout::checkEvents()
|
||||
{
|
||||
Window::checkEvents();
|
||||
if (lastFM != mixerCurrentFlightMode) {
|
||||
lastFM = mixerCurrentFlightMode;
|
||||
updateZones();
|
||||
}
|
||||
}
|
||||
|
||||
const ZoneOption defaultZoneOptions[] = {LAYOUT_COMMON_OPTIONS,
|
||||
LAYOUT_OPTIONS_END};
|
||||
|
||||
@@ -113,6 +113,7 @@ class Layout: public LayoutBase
|
||||
std::unique_ptr<ViewMainDecoration> decoration;
|
||||
uint8_t zoneCount;
|
||||
uint8_t* zoneMap = nullptr;
|
||||
uint8_t lastFM = 0;
|
||||
|
||||
// Last time we refreshed the window
|
||||
uint32_t lastRefresh = 0;
|
||||
@@ -122,6 +123,8 @@ class Layout: public LayoutBase
|
||||
|
||||
unsigned int getZonesCount() const override { return zoneCount; }
|
||||
rect_t getZone(unsigned int index) const override;
|
||||
|
||||
void checkEvents() override;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
|
||||
Reference in New Issue
Block a user