Skip to content

Commit

Permalink
Always fixed layout for speaker avatars
Browse files Browse the repository at this point in the history
  • Loading branch information
svenreimers committed Oct 3, 2023
1 parent 21a7eb5 commit 3e8364f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,16 @@ private Pane createSessionNode(final MachineContext context, final SessionData s
}
topLeft = new HBox(4, topLeftVBox, speakerImages);
} else {
var speakerImages = new HBox(config.avatarSpacing, sessionData.speakerObjects.stream()
var speakerImages = new Pane();
var images = sessionData.speakerObjects.stream()
.map(speaker -> createSpeakerImage(speakerImageProvider, speaker))
.toArray(Node[]::new)
);
.toList();
for (int i = 0; i < images.size(); i++) {
var image = images.get(i);
image.setLayoutX(i * (config.avatarSize + config.avatarSpacing));
image.setLayoutY(2);
speakerImages.getChildren().add(image);
}
topLeft = new HBox(4, topLeftVBox, speakerImages);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,16 @@ private Pane createTalkNode(final MachineContext context, final VotedTalk votedT
}
topLeft = new HBox(4, topLeftVBox, speakerImages);
} else {
var speakerImages = new HBox(config.avatarSpacing, votedTalk.speakers.stream()
var speakerImages = new Pane();
var images = votedTalk.speakers.stream()
.map(speaker -> createSpeakerImage(speakerImageProvider, speaker))
.toArray(Node[]::new)
);
.toList();
for (int i = 0; i < images.size(); i++) {
var image = images.get(i);
image.setLayoutX(i * (config.avatarSize + config.avatarSpacing));
image.setLayoutY(2);
speakerImages.getChildren().add(image);
}
topLeft = new HBox(4, topLeftVBox, speakerImages);
}
}
Expand Down

0 comments on commit 3e8364f

Please sign in to comment.