2025-01-09 16:24:59 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <solanaceae/message3/registry_message_model.hpp>
|
|
|
|
|
2024-12-25 17:21:07 +01:00
|
|
|
#include "./sys_tray.hpp"
|
|
|
|
|
2025-01-09 16:24:59 +01:00
|
|
|
#include <SDL3/SDL.h>
|
|
|
|
|
|
|
|
// service that sets window and tray icon depending on program state
|
|
|
|
|
|
|
|
class StatusIndicator {
|
|
|
|
RegistryMessageModelI& _rmm;
|
2025-03-06 19:12:35 +01:00
|
|
|
ContactStore4I& _cs;
|
2025-01-09 16:24:59 +01:00
|
|
|
|
|
|
|
SDL_Window* _main_window;
|
2024-12-25 17:21:07 +01:00
|
|
|
SystemTray* _tray;
|
2025-01-09 16:24:59 +01:00
|
|
|
|
|
|
|
float _cooldown {1.f};
|
|
|
|
|
|
|
|
enum class State {
|
|
|
|
base,
|
|
|
|
unread,
|
|
|
|
none, // only used for initialization
|
|
|
|
} _state = State::none;
|
|
|
|
|
|
|
|
void updateState(State state);
|
|
|
|
|
|
|
|
public:
|
|
|
|
StatusIndicator(
|
|
|
|
RegistryMessageModelI& rmm,
|
2025-03-06 19:12:35 +01:00
|
|
|
ContactStore4I& cs,
|
2024-12-25 17:21:07 +01:00
|
|
|
SDL_Window* main_window,
|
|
|
|
SystemTray* tray = nullptr
|
2025-01-09 16:24:59 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
// does not actually render, just on the render thread
|
|
|
|
void render(float delta);
|
|
|
|
};
|
|
|
|
|