From 94568a39fb852fd7f7a94c1bd3200404c64f690a Mon Sep 17 00:00:00 2001 From: Pawel Olejniczak Date: Fri, 5 Nov 2021 17:36:33 +0100 Subject: [PATCH] [EGD-7498] Disable message SEND button when recipient empty SEND message button is now visible and active only when recipient field is not empty. --- .../application-messages/windows/NewMessage.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/module-apps/application-messages/windows/NewMessage.cpp b/module-apps/application-messages/windows/NewMessage.cpp index 0c977bb4cb7470ba052209be555422f653266f6b..72d55cef6362b901a41c5395abff041d4a6abedd 100644 --- a/module-apps/application-messages/windows/NewMessage.cpp +++ b/module-apps/application-messages/windows/NewMessage.cpp @@ -258,13 +258,21 @@ namespace gui message->setFont(style::window::font::medium); message->setAlignment(Alignment(gui::Alignment::Horizontal::Left, gui::Alignment::Vertical::Center)); message->activatedCallback = [=](Item &) -> bool { + if (recipient->getText().empty() || message->getText().empty()) { + return false; + } if (!sendSms()) { LOG_ERROR("sendSms failed"); } return true; }; message->focusChangedCallback = [=](Item &) -> bool { - navBar->setText(nav_bar::Side::Center, utils::translate(style::strings::common::send)); + if (recipient->getText().empty()) { + navBar->setActive(nav_bar::Side::Center, false); + } + else { + navBar->setText(nav_bar::Side::Center, utils::translate(style::strings::common::send)); + } navBar->setActive(nav_bar::Side::Left, true); return true; };