mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-20 15:07:17 -04:00
* [EGD-4051] Based application manager app switching on application stack. * [EGD-4051] Application manager thorough refactor.
45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "NoEvents.hpp"
|
|
#include "Dialog.hpp"
|
|
#include "DialogMetadataMessage.hpp"
|
|
#include "log/log.hpp"
|
|
|
|
#include <service-appmgr/Controller.hpp>
|
|
|
|
using namespace gui;
|
|
|
|
namespace style
|
|
{
|
|
namespace arrow
|
|
{
|
|
const inline uint32_t x = 30;
|
|
const inline uint32_t y = 62;
|
|
} // namespace arrow
|
|
|
|
namespace cross
|
|
{
|
|
const inline uint32_t x = 48;
|
|
const inline uint32_t y = 55;
|
|
} // namespace cross
|
|
} // namespace style
|
|
|
|
NoEvents::NoEvents(app::Application *app, const std::string &name) : gui::Dialog(app, name)
|
|
{}
|
|
|
|
void NoEvents::onBeforeShow(ShowMode mode, SwitchData *data)
|
|
{
|
|
Dialog::onBeforeShow(mode, data);
|
|
auto metadata = dynamic_cast<DialogMetadataMessage *>(data);
|
|
if (metadata != nullptr) {
|
|
auto foo = metadata->get().action;
|
|
inputCallback = [foo](Item &, const InputEvent &inputEvent) -> bool {
|
|
if (foo && inputEvent.isShortPress() && inputEvent.is(KeyCode::KEY_LEFT)) {
|
|
return foo();
|
|
}
|
|
return false;
|
|
};
|
|
}
|
|
}
|