From b653652f6d7164385a3c6e87723c7e0b24c9fea5 Mon Sep 17 00:00:00 2001 From: delvh Date: Sun, 22 Nov 2020 12:26:08 +0100 Subject: [PATCH] Fix chat default pictures not being updated on theme change --- .../java/envoy/client/ui/control/ChatControl.java | 12 +++++++++++- .../java/envoy/client/ui/controller/ChatScene.java | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/client/src/main/java/envoy/client/ui/control/ChatControl.java b/client/src/main/java/envoy/client/ui/control/ChatControl.java index 6c45d44..cbf9425 100644 --- a/client/src/main/java/envoy/client/ui/control/ChatControl.java +++ b/client/src/main/java/envoy/client/ui/control/ChatControl.java @@ -18,7 +18,7 @@ import envoy.client.util.IconUtil; */ public final class ChatControl extends HBox { - private static final Image userIcon = IconUtil.loadIconThemeSensitive("user_icon", 32), + private static Image userIcon = IconUtil.loadIconThemeSensitive("user_icon", 32), groupIcon = IconUtil.loadIconThemeSensitive("group_icon", 32); /** @@ -60,4 +60,14 @@ public final class ChatControl extends HBox { } getStyleClass().add("list-element"); } + + /** + * Reloads the default icons. + * + * @since Envoy Client v0.3-beta + */ + public static void reloadDefaultChatIcons() { + userIcon = IconUtil.loadIconThemeSensitive("user_icon", 32); + groupIcon = IconUtil.loadIconThemeSensitive("group_icon", 32); + } } diff --git a/client/src/main/java/envoy/client/ui/controller/ChatScene.java b/client/src/main/java/envoy/client/ui/controller/ChatScene.java index 74499c2..64d1c5c 100644 --- a/client/src/main/java/envoy/client/ui/controller/ChatScene.java +++ b/client/src/main/java/envoy/client/ui/controller/ChatScene.java @@ -324,6 +324,7 @@ public final class ChatScene implements EventListener, Restorable, KeyboardMappi @Event(eventType = ThemeChangeEvent.class) private void onThemeChange() { + ChatControl.reloadDefaultChatIcons(); settingsButton.setGraphic( new ImageView(IconUtil.loadIconThemeSensitive("settings", DEFAULT_ICON_SIZE))); voiceButton.setGraphic(