Files
MuditaOS/module-apps/application-notes/windows/NoteCreateWindow.cpp
Piotr Tański 84cf9def94 [EGD-7040] Notes autosave
Notes are automatically saved on exiting the edit window.
2021-07-07 18:19:30 +02:00

24 lines
758 B
C++

// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "NoteCreateWindow.hpp"
namespace app::notes
{
bool NoteCreateWindow::onInput(const gui::InputEvent &inputEvent)
{
if (inputEvent.isShortRelease(gui::KeyCode::KEY_ENTER)) {
if (!bottomBar->isActive(gui::BottomBar::Side::CENTER)) {
return false;
}
}
return NoteEditWindow::onInput(inputEvent);
}
void NoteCreateWindow::onCharactersCountChanged(std::uint32_t count)
{
NoteEditWindow::onCharactersCountChanged(count);
bottomBar->setActive(gui::BottomBar::Side::CENTER, count != 0U);
}
} // namespace app::notes