Merge pull request #745 from jihuayu/javafx

fix #744
This commit is contained in:
Yuhui Huang 2020-07-14 23:33:33 +08:00 committed by GitHub
commit 22a02faced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,16 +32,17 @@ public class GameAdvancedListItem extends AdvancedListItem {
public GameAdvancedListItem() {
tooltip = new Tooltip();
FXUtils.installFastTooltip(this, tooltip);
FXUtils.onChangeAndOperate(Profiles.selectedVersionProperty(), version -> {
if (version != null && Profiles.getSelectedProfile() != null &&
Profiles.getSelectedProfile().getRepository().hasVersion(version)) {
FXUtils.installFastTooltip(this, tooltip);
setTitle(version);
setSubtitle(null);
setImage(Profiles.getSelectedProfile().getRepository().getVersionIconImage(version));
tooltip.setText(version);
} else {
Tooltip.uninstall(this,tooltip);
setTitle(i18n("version.empty"));
setSubtitle(i18n("version.empty.add"));
setImage(newImage("/assets/img/grass.png"));