Merge pull request 'Update Default Chat Pictures on Theme Change' (#115) from b/ui-fixes into develop
zdm/envoy/pipeline/head This commit looks good Details

Reviewed-on: https://git.kske.dev/zdm/envoy/pulls/115
Reviewed-by: delvh <leon@kske.dev>
develop
Kai S. K. Engelbart 2021-12-04 09:22:53 +01:00
commit 6499a4f698
Signed by: Käfer & Engelbart Git
GPG Key ID: 70F2F9206EDC1FCE
2 changed files with 12 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -326,6 +326,7 @@ public final class ChatScene implements Restorable, KeyboardMapping {
@Event(ThemeChangeEvent.class)
private void onThemeChange() {
ChatControl.reloadDefaultChatIcons();
settingsButton.setGraphic(
new ImageView(IconUtil.loadIconThemeSensitive("settings", DEFAULT_ICON_SIZE)));
voiceButton.setGraphic(