Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avatar Overhaul #191

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Conversation

Spikey84
Copy link

@Spikey84 Spikey84 commented Oct 19, 2023

Makes many improvements to the avatar menu. Most importantly reduces lag due to slow loading of images on the main thread. Also saves a log file for debugging.

@Spikey84 Spikey84 changed the title Avatar overhaul Avatar Overhaul Oct 19, 2023
Comment on lines +268 to +287
TableColumn<AvatarAssignmentFX, AvatarAssignmentFX> removeColumn = new TableColumn<>("Remove");
removeColumn.setMinWidth(90);
removeColumn.setCellValueFactory(param -> new SimpleObjectProperty<>(param.getValue()));
removeColumn.setCellFactory(param -> new TableCell<AvatarAssignmentFX, AvatarAssignmentFX>() {

@Override
protected void updateItem(AvatarAssignmentFX item, boolean empty) {
super.updateItem(item, empty);
if (!empty) {
Button button = new Button("Remove");
button.setOnMouseClicked(event -> onRemove.accept(item));
button.setTextFill(Color.rgb(200, 10, 10));

setGraphic(button);
return;
}
setGraphic(null);
}
});
tableView.getColumns().add(removeColumn);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this only be added if onRemove != null?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants