mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-10-08 22:16:51 -04:00
1. Prepare Pure and Bell specific `Application` classes and add them to `app` target: - `products/BellHybrid/apps/Application.cpp` - `products/PurePhone/apps/Application.cpp` 2. Update `CMakeLists.txt` files. 3. Move `ApplicationBell` implementation to Bell-specific `Application` class and remove `ApplicationBell` files. 4. Change Bell apps parent classes from `ApplicationBell` to Bell-specific `Application` class. 5. Rename `Application` to `ApplicationCommon` in the rest of the files.
42 lines
1.6 KiB
C++
42 lines
1.6 KiB
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "EinkModeWindow.hpp"
|
|
|
|
#include <application-settings/windows/WindowNames.hpp>
|
|
|
|
#include <Application.hpp>
|
|
#include <service-eink/Common.hpp>
|
|
#include <service-eink/messages/EinkModeMessage.hpp>
|
|
|
|
namespace gui
|
|
{
|
|
|
|
EinkModeWindow::EinkModeWindow(app::ApplicationCommon *app) : AppWindow(app, window::name::eink_mode)
|
|
{
|
|
AppWindow::buildInterface();
|
|
bottomBar->setActive(BottomBar::Side::CENTER, true);
|
|
bottomBar->setActive(BottomBar::Side::RIGHT, true);
|
|
bottomBar->setText(BottomBar::Side::CENTER, utils::translate(style::strings::common::select));
|
|
bottomBar->setText(BottomBar::Side::RIGHT, utils::translate(style::strings::common::back));
|
|
|
|
setTitle(window::name::eink_mode);
|
|
auto label = new Label(this, 100, 200, 300, 50, "Change mode on click");
|
|
label->activatedCallback = [this](Item &) -> bool {
|
|
static auto last_mode = service::eink::EinkModeMessage::Mode::Normal;
|
|
if (last_mode == service::eink::EinkModeMessage::Mode::Normal) {
|
|
last_mode = service::eink::EinkModeMessage::Mode::Invert;
|
|
}
|
|
else {
|
|
last_mode = service::eink::EinkModeMessage::Mode::Normal;
|
|
}
|
|
|
|
application->bus.sendUnicastSync(
|
|
std::make_shared<service::eink::EinkModeMessage>(last_mode), service::name::eink, 5000);
|
|
return true;
|
|
};
|
|
setFocusItem(label);
|
|
}
|
|
|
|
} /* namespace gui */
|