mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Utils(GetTrayIcon): refactor with frontend API function
This commit is contained in:
parent
6734c928a2
commit
d91b3f8dd9
@ -485,11 +485,8 @@ QString Utils::OBSVersionString() {
|
||||
}
|
||||
|
||||
QSystemTrayIcon* Utils::GetTrayIcon() {
|
||||
QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window();
|
||||
if (!main) return nullptr;
|
||||
|
||||
QList<QSystemTrayIcon*> trays = main->findChildren<QSystemTrayIcon*>();
|
||||
return trays.isEmpty() ? nullptr : trays.first();
|
||||
void* systemTray = obs_frontend_get_system_tray();
|
||||
return reinterpret_cast<QSystemTrayIcon*>(systemTray);
|
||||
}
|
||||
|
||||
void Utils::SysTrayNotify(QString text,
|
||||
|
Loading…
x
Reference in New Issue
Block a user