Add option to disable system tray icon
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user