Skip to content

Commit

Permalink
show info below fluff image
Browse files Browse the repository at this point in the history
  • Loading branch information
SJuliez committed Aug 23, 2024
1 parent 4d1af5c commit 15eef9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion megamek/src/megamek/client/ui/swing/FluffImageTooltip.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private static String getTooltip(File yamlFile) {
JsonNode node = yamlMapper.readTree(yamlFile);

StringBuilder result = new StringBuilder("<HTML><HEAD><STYLE>" + styles() + "</STYLE></HEAD><BODY>");
int width = UIUtil.scaleForGUI(400);
int width = UIUtil.scaleForGUI(360);
result.append("<div width=").append(width).append(">");

if (node.has("title")) {
Expand Down
2 changes: 2 additions & 0 deletions megamek/src/megamek/client/ui/swing/MechViewPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public MechViewPanel(int width, int height, boolean noBorder) {
fluffPanel.setAlignmentY(0);
fluffPanel.add(imageControlsPanel);
fluffPanel.add(fluffImageLabel);
fluffPanel.add(Box.createVerticalStrut(10));
fluffPanel.add(imageInfoLabel);

Box p = Box.createHorizontalBox();
Expand Down Expand Up @@ -206,6 +207,7 @@ private void changeFluffImageIndex(int delta) {
setFluffImage(record.getImage());
imageInfoLabel.setText(prepareLabelText(record.file()));
fluffImageLabel.setToolTipText(FluffImageTooltip.getTooltip(record));
imageInfoLabel.setText(FluffImageTooltip.getTooltip(record));
} catch (IOException ex) {
setFluffImage((Image) null);
imageInfoLabel.setText("Error loading fluff image");
Expand Down

0 comments on commit 15eef9a

Please sign in to comment.