From 9858ce217e35501cdca418d58809b4ed1c1b4de6 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 6 Apr 2021 08:47:09 +0200 Subject: [PATCH] [Checkbox] Fix when disabled --- radio/src/thirdparty/libopenui/src/button.cpp | 8 +++----- radio/src/thirdparty/libopenui/src/checkbox.cpp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/button.cpp b/radio/src/thirdparty/libopenui/src/button.cpp index 3f2b349db..150381057 100644 --- a/radio/src/thirdparty/libopenui/src/button.cpp +++ b/radio/src/thirdparty/libopenui/src/button.cpp @@ -36,11 +36,9 @@ void Button::onEvent(event_t event) { TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("Button").c_str(), event); - if (event == EVT_KEY_BREAK(KEY_ENTER)) { - if (enabled) { - onKeyPress(); - onPress(); - } + if (enabled && event == EVT_KEY_BREAK(KEY_ENTER)) { + onKeyPress(); + onPress(); } else { FormField::onEvent(event); diff --git a/radio/src/thirdparty/libopenui/src/checkbox.cpp b/radio/src/thirdparty/libopenui/src/checkbox.cpp index 18f0cb458..8fea8fcb3 100644 --- a/radio/src/thirdparty/libopenui/src/checkbox.cpp +++ b/radio/src/thirdparty/libopenui/src/checkbox.cpp @@ -30,7 +30,7 @@ void CheckBox::onEvent(event_t event) { TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("CheckBox").c_str(), event); - if (event == EVT_KEY_BREAK(KEY_ENTER)) { + if (enabled && event == EVT_KEY_BREAK(KEY_ENTER)) { onKeyPress(); _setValue(!getValue()); invalidate();