From 7f8a2ac069d6597ba57c21c11044065a98f82c9a Mon Sep 17 00:00:00 2001 From: TheFaser Date: Sun, 31 Dec 2023 02:00:45 +0500 Subject: [PATCH] add opening discord url by avatar --- .../flectone/mix/javafx/controller/LeftPanelController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/net/flectone/mix/javafx/controller/LeftPanelController.java b/src/main/java/net/flectone/mix/javafx/controller/LeftPanelController.java index b776cb0..bb472c8 100644 --- a/src/main/java/net/flectone/mix/javafx/controller/LeftPanelController.java +++ b/src/main/java/net/flectone/mix/javafx/controller/LeftPanelController.java @@ -16,6 +16,7 @@ import net.flectone.mix.javafx.component.FToolTip; import net.flectone.mix.javafx.component.PaneType; import net.flectone.mix.model.DiscordUser; +import net.flectone.mix.util.WebUtil; import java.net.URL; import java.util.HashMap; @@ -23,6 +24,8 @@ public class LeftPanelController implements Initializable { + private static final String DISCORD_URL = "https://discord.flectone.net"; + @FXML private ImageView optimizationImage; @FXML @@ -66,6 +69,7 @@ public void initialize(URL url, ResourceBundle resourceBundle) { DiscordUser discordUser = FlectoneMix.getApp().getDiscordUser(); discordLabel.setText(discordUser.username()); avatarRectangle.setFill(new ImagePattern(discordUser.getAvatar())); + avatarRectangle.setOnMousePressed(e -> WebUtil.openUrl(DISCORD_URL)); TABS.get(optimizationImage).getFColorTransition().setSelected(true); selectedImage = optimizationImage;