system tray support

This commit is contained in:
Green Sky
2024-12-25 17:21:07 +01:00
parent 859ad7df81
commit 2fa116b76b
10 changed files with 187 additions and 8 deletions

24
src/sys_tray.hpp Normal file
View File

@@ -0,0 +1,24 @@
#pragma once
#include <SDL3/SDL.h>
#include <string>
class SystemTray {
SDL_Window* _main_window {nullptr};
SDL_Tray* _tray {nullptr};
SDL_TrayEntry* _entry_showhide {nullptr};
SDL_TrayEntry* _entry_status {nullptr};
public:
SystemTray(SDL_Window* main_window);
~SystemTray(void);
void setIcon(SDL_Surface* surf);
void setStatusText(const std::string& status);
// check if window is visible and adjust text
void update(void);
};