fix(tray): use PROJECT_NAME definition for tooltip (#1958)

This commit is contained in:
ReenigneArcher
2023-12-31 16:34:33 -05:00
committed by GitHub
parent 64be0aa67a
commit fe3bf0ee6f
2 changed files with 5 additions and 7 deletions

View File

@@ -40,12 +40,12 @@
#include "main.h" #include "main.h"
#include "platform/common.h" #include "platform/common.h"
#include "process.h" #include "process.h"
#include "version.h"
using namespace std::literals; using namespace std::literals;
// system_tray namespace // system_tray namespace
namespace system_tray { namespace system_tray {
/** /**
* @brief Callback for opening the UI from the system tray. * @brief Callback for opening the UI from the system tray.
* @param item The tray menu item. * @param item The tray menu item.
@@ -126,9 +126,7 @@ namespace system_tray {
// Tray menu // Tray menu
static struct tray tray = { static struct tray tray = {
.icon = TRAY_ICON, .icon = TRAY_ICON,
#if defined(_WIN32) .tooltip = PROJECT_NAME,
.tooltip = const_cast<char *>("Sunshine"), // cast the string literal to a non-const char* pointer
#endif
.menu = .menu =
(struct tray_menu[]) { (struct tray_menu[]) {
// todo - use boost/locale to translate menu strings // todo - use boost/locale to translate menu strings
@@ -340,7 +338,7 @@ namespace system_tray {
tray.notification_icon = TRAY_ICON; tray.notification_icon = TRAY_ICON;
tray.notification_title = "Application Stopped"; tray.notification_title = "Application Stopped";
tray.notification_text = msg; tray.notification_text = msg;
tray.tooltip = "Sunshine"; tray.tooltip = PROJECT_NAME;
tray_update(&tray); tray_update(&tray);
} }
@@ -359,7 +357,7 @@ namespace system_tray {
tray.notification_title = "Incoming Pairing Request"; tray.notification_title = "Incoming Pairing Request";
tray.notification_text = "Click here to complete the pairing process"; tray.notification_text = "Click here to complete the pairing process";
tray.notification_icon = TRAY_ICON_LOCKED; tray.notification_icon = TRAY_ICON_LOCKED;
tray.tooltip = "Sunshine"; tray.tooltip = PROJECT_NAME;
tray.notification_cb = []() { tray.notification_cb = []() {
launch_ui_with_path("/pin"); launch_ui_with_path("/pin");
}; };