Navigation fix in telemetry page

This commit is contained in:
Bertrand Songis
2019-08-29 09:06:15 +02:00
parent f4f8893ae9
commit ff78e71d11
+7 -5
View File
@@ -64,6 +64,8 @@ class SensorButton : public Button {
if (telemetryItem.isFresh()) { if (telemetryItem.isFresh()) {
invalidate(); invalidate();
} }
Button::checkEvents();
} }
void paint(BitmapBuffer * dc) override void paint(BitmapBuffer * dc) override
@@ -102,7 +104,7 @@ class SensorButton : public Button {
class SensorEditWindow : public Page { class SensorEditWindow : public Page {
public: public:
SensorEditWindow(uint8_t index) : explicit SensorEditWindow(uint8_t index) :
Page(ICON_MODEL_TELEMETRY), Page(ICON_MODEL_TELEMETRY),
index(index) index(index)
{ {
@@ -110,7 +112,7 @@ class SensorEditWindow : public Page {
buildHeader(&header); buildHeader(&header);
} }
~SensorEditWindow() ~SensorEditWindow() override
{ {
body.deleteChildren(); body.deleteChildren();
} }
@@ -483,9 +485,9 @@ void ModelTelemetryPage::build(FormWindow * window, int8_t focusSensorIndex)
// New sensor button // New sensor button
new TextButton(window, grid.getLineSlot(), STR_TELEMETRY_NEWSENSOR, new TextButton(window, grid.getLineSlot(), STR_TELEMETRY_NEWSENSOR,
[=]() -> uint8_t { [=]() -> uint8_t {
int res = availableTelemetryIndex(); int idx = availableTelemetryIndex();
if (res >= 0) if (idx >= 0)
editSensor(window, res); editSensor(window, idx);
else else
new FullScreenDialog(WARNING_TYPE_ALERT, "", STR_TELEMETRYFULL); new FullScreenDialog(WARNING_TYPE_ALERT, "", STR_TELEMETRYFULL);
return 0; return 0;