~aleteoryx/muditaos

94568a39fb852fd7f7a94c1bd3200404c64f690a — Pawel Olejniczak 4 years ago b64f828
[EGD-7498] Disable message SEND button when recipient empty

SEND message button is now visible and active only
when recipient field is not empty.
1 files changed, 9 insertions(+), 1 deletions(-)

M module-apps/application-messages/windows/NewMessage.cpp
M module-apps/application-messages/windows/NewMessage.cpp => module-apps/application-messages/windows/NewMessage.cpp +9 -1
@@ 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;
        };