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() {
|
QSystemTrayIcon* Utils::GetTrayIcon() {
|
||||||
QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window();
|
void* systemTray = obs_frontend_get_system_tray();
|
||||||
if (!main) return nullptr;
|
return reinterpret_cast<QSystemTrayIcon*>(systemTray);
|
||||||
|
|
||||||
QList<QSystemTrayIcon*> trays = main->findChildren<QSystemTrayIcon*>();
|
|
||||||
return trays.isEmpty() ? nullptr : trays.first();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Utils::SysTrayNotify(QString text,
|
void Utils::SysTrayNotify(QString text,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user