mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-21 16:55:29 -05:00
Add support setting title and icon of system tray message
This commit is contained in:
@@ -466,15 +466,19 @@ bool DisplayMessage(const QString &msg, bool question)
|
||||
return false;
|
||||
}
|
||||
|
||||
void DisplayTrayMessage(const QString &title, const QString &msg)
|
||||
void DisplayTrayMessage(const QString &title, const QString &msg,
|
||||
const QIcon &icon)
|
||||
{
|
||||
auto tray = reinterpret_cast<QSystemTrayIcon *>(
|
||||
obs_frontend_get_system_tray());
|
||||
if (!tray) {
|
||||
return;
|
||||
}
|
||||
|
||||
tray->showMessage(title, msg);
|
||||
if (icon.isNull()) {
|
||||
tray->showMessage(title, msg);
|
||||
} else {
|
||||
tray->showMessage(title, msg, icon);
|
||||
}
|
||||
}
|
||||
|
||||
void AddSelectionEntry(QComboBox *sel, const char *description, bool selectable,
|
||||
|
||||
@@ -100,7 +100,8 @@ int FindIdxInRagne(QComboBox *list, int start, int stop,
|
||||
/* UI helpers */
|
||||
|
||||
bool DisplayMessage(const QString &msg, bool question = false);
|
||||
void DisplayTrayMessage(const QString &title, const QString &msg);
|
||||
void DisplayTrayMessage(const QString &title, const QString &msg,
|
||||
const QIcon &icon = QIcon());
|
||||
bool WindowPosValid(QPoint pos);
|
||||
std::string GetThemeTypeName();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user