Remove Constants.DEFAULT_ICON

This commit is contained in:
yushijinhun 2018-09-22 12:52:30 +08:00
parent ed91771594
commit 9b69fe8c56
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4
2 changed files with 5 additions and 15 deletions

View File

@ -42,7 +42,6 @@ import org.jackhuang.hmcl.task.Task;
import org.jackhuang.hmcl.ui.Controllers;
import org.jackhuang.hmcl.ui.FXUtils;
import org.jackhuang.hmcl.ui.construct.*;
import org.jackhuang.hmcl.util.Constants;
import org.jackhuang.hmcl.util.Logging;
import java.util.List;
@ -190,6 +189,7 @@ public class AddAccountPane extends StackPane {
}
private class Selector extends BorderPane implements CharacterSelector {
private final AdvancedListBox listBox = new AdvancedListBox();
private final JFXButton cancel = new JFXButton();
@ -225,16 +225,13 @@ public class AddAccountPane extends StackPane {
image = AccountHelper.getSkinImmediately(yggdrasilAccount, profile, 4);
} catch (Exception e) {
Logging.LOG.log(Level.WARNING, "Failed to get skin for " + profile.getName(), e);
image = null;
image = AccountHelper.getDefaultSkin(profile.getId(), 4);
}
ImageView portraitView = new ImageView();
portraitView.setSmooth(false);
if (image == null) {
portraitView.setImage(Constants.DEFAULT_ICON.get());
} else {
portraitView.setImage(image);
portraitView.setViewport(AccountHelper.getViewport(4));
}
portraitView.setImage(image);
portraitView.setViewport(AccountHelper.getViewport(4));
FXUtils.limitSize(portraitView, 32, 32);
IconedItem accountItem = new IconedItem(portraitView, profile.getName());

View File

@ -17,10 +17,6 @@
*/
package org.jackhuang.hmcl.util;
import javafx.beans.binding.Bindings;
import javafx.beans.binding.ObjectBinding;
import javafx.scene.image.Image;
import org.jackhuang.hmcl.task.Schedulers;
import org.jackhuang.hmcl.util.platform.OperatingSystem;
@ -59,7 +55,4 @@ public final class Constants {
else
javafx.application.Platform.runLater(s);
};
// lazy loading
public static final ObjectBinding<Image> DEFAULT_ICON = Bindings.createObjectBinding(() -> new Image("/assets/img/icon.png"));
}