Add option to disable system tray icon

This commit is contained in:
testing-ongithub
2021-12-18 18:08:44 -06:00
committed by Adam
parent 0db23d4d7a
commit fab6e46786
2 changed files with 25 additions and 9 deletions

View File

@@ -185,11 +185,24 @@ public interface RuneLiteConfig extends Config
return true;
}
@ConfigItem(
keyName = "trayIcon",
name = "Enable tray icon",
description = "Enables icon in system tray",
warning = "Disabling this may limit your ability to receive tray notifications.\nPlease restart your client after changing this setting.",
position = 20,
section = notificationSettings
)
default boolean enableTrayIcon()
{
return true;
}
@ConfigItem(
keyName = "notificationTray",
name = "Enable tray notifications",
description = "Enables tray notifications",
position = 20,
position = 21,
section = notificationSettings
)
default boolean enableTrayNotifications()
@@ -201,7 +214,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationRequestFocus",
name = "Request focus",
description = "Configures the window focus request type on notification",
position = 21,
position = 22,
section = notificationSettings
)
default RequestFocusType notificationRequestFocus()
@@ -213,7 +226,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationSound",
name = "Notification sound",
description = "Enables the playing of a beep sound when notifications are displayed",
position = 22,
position = 23,
section = notificationSettings
)
default Notifier.NativeCustomOff notificationSound()
@@ -225,7 +238,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationTimeout",
name = "Notification timeout",
description = "How long notification will be shown in milliseconds. A value of 0 will make it use the system configuration. (Linux only)",
position = 23,
position = 24,
section = notificationSettings
)
@Units(Units.MILLISECONDS)
@@ -238,7 +251,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationGameMessage",
name = "Game message notifications",
description = "Adds a notification message to the chatbox",
position = 24,
position = 25,
section = notificationSettings
)
default boolean enableGameMessageNotification()
@@ -250,7 +263,7 @@ public interface RuneLiteConfig extends Config
keyName = "flashNotification",
name = "Flash",
description = "Flashes the game frame as a notification",
position = 25,
position = 26,
section = notificationSettings
)
default FlashNotification flashNotification()
@@ -262,7 +275,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationFocused",
name = "Send notifications when focused",
description = "Toggles all notifications for when the client is focused",
position = 26,
position = 27,
section = notificationSettings
)
default boolean sendNotificationsWhenFocused()
@@ -275,7 +288,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationFlashColor",
name = "Notification Flash",
description = "Sets the color of the notification flashes.",
position = 27,
position = 28,
section = notificationSettings
)
default Color notificationFlashColor()

View File

@@ -521,7 +521,10 @@ public class ClientUI
frame.revalidateMinimumSize();
// Create tray icon (needs to be created after frame is packed)
trayIcon = SwingUtil.createTrayIcon(ICON, title, frame);
if (config.enableTrayIcon())
{
trayIcon = SwingUtil.createTrayIcon(ICON, title, frame);
}
// Move frame around (needs to be done after frame is packed)
if (config.rememberScreenBounds() && !safeMode)