From 15eef9a4625064f84b343f738cf7294163d01485 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 23 Aug 2024 09:57:49 +0200 Subject: [PATCH] show info below fluff image --- megamek/src/megamek/client/ui/swing/FluffImageTooltip.java | 2 +- megamek/src/megamek/client/ui/swing/MechViewPanel.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/megamek/src/megamek/client/ui/swing/FluffImageTooltip.java b/megamek/src/megamek/client/ui/swing/FluffImageTooltip.java index 3e30054a55..c7a7380874 100644 --- a/megamek/src/megamek/client/ui/swing/FluffImageTooltip.java +++ b/megamek/src/megamek/client/ui/swing/FluffImageTooltip.java @@ -70,7 +70,7 @@ private static String getTooltip(File yamlFile) { JsonNode node = yamlMapper.readTree(yamlFile); StringBuilder result = new StringBuilder(""); - int width = UIUtil.scaleForGUI(400); + int width = UIUtil.scaleForGUI(360); result.append("
"); if (node.has("title")) { diff --git a/megamek/src/megamek/client/ui/swing/MechViewPanel.java b/megamek/src/megamek/client/ui/swing/MechViewPanel.java index 2516390168..56f570c316 100644 --- a/megamek/src/megamek/client/ui/swing/MechViewPanel.java +++ b/megamek/src/megamek/client/ui/swing/MechViewPanel.java @@ -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(); @@ -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");