Skip to content

Commit

Permalink
add opening discord url by avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFaser committed Dec 30, 2023
1 parent 44cc9ae commit 7f8a2ac
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
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;
import java.util.ResourceBundle;

public class LeftPanelController implements Initializable {

private static final String DISCORD_URL = "https://discord.flectone.net";

@FXML
private ImageView optimizationImage;
@FXML
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 7f8a2ac

Please sign in to comment.