From ab95c7e60d3989543b0b4f58ce0a2846bc777ca0 Mon Sep 17 00:00:00 2001 From: Pavel Brychta Date: Tue, 2 Feb 2021 09:58:14 +0100 Subject: [PATCH] Moznost nastavit defaultni vysledek z YesNo dialogu --- src/dialogs/yesno.cpp | 3 ++- src/dialogs/yesno.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dialogs/yesno.cpp b/src/dialogs/yesno.cpp index 6fbf6c7..97eea55 100644 --- a/src/dialogs/yesno.cpp +++ b/src/dialogs/yesno.cpp @@ -55,11 +55,12 @@ void drawYesNo(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16 } } -void dialog_prepareYesNoFrame(String text) +void dialog_prepareYesNoFrame(String text, bool defaultResult) { yesnotext = text; done = false; + yesNoResult = defaultResult; ui.goToFrame(ui.getFrameIndex(drawYesNo)); } diff --git a/src/dialogs/yesno.h b/src/dialogs/yesno.h index b907b6c..766b673 100644 --- a/src/dialogs/yesno.h +++ b/src/dialogs/yesno.h @@ -4,7 +4,7 @@ void drawYesNo(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y); -void dialog_prepareYesNoFrame(String text); +void dialog_prepareYesNoFrame(String text, bool defaultResult = false); bool dialog_getYesNoResult(void);