mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-20 15:07:17 -04:00
There is need of popup window on volume key pressed event. This PR handles: Creating base popup window attached to application desktop. Creating volume window. Audio key events logic implementation.
29 lines
943 B
C++
29 lines
943 B
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include "AppWindow.hpp"
|
|
#include <module-sys/Timers/TimerHandle.hpp>
|
|
|
|
namespace gui
|
|
{
|
|
inline constexpr auto defautTimeout = std::chrono::milliseconds{3000};
|
|
class WindowWithTimer : public gui::AppWindow
|
|
{
|
|
private:
|
|
sys::TimerHandle popupTimer;
|
|
void resetTimer();
|
|
void detachTimerIfExists();
|
|
|
|
public:
|
|
explicit WindowWithTimer(app::Application *app,
|
|
const std::string &name,
|
|
const std::chrono::milliseconds timeout = defautTimeout);
|
|
void destroyInterface() override;
|
|
~WindowWithTimer() override;
|
|
void onBeforeShow(ShowMode mode, SwitchData *data) override;
|
|
bool onInput(const gui::InputEvent &inputEvent) override;
|
|
};
|
|
} // namespace gui
|