Skip to content

Commit

Permalink
Add a tooltip to each label and image with the description of the pac…
Browse files Browse the repository at this point in the history
…k or mod.

This should close SkyblockClient#36. For some reason the tooltips only show up if you are not on the first tab of the JTabbedPane.
  • Loading branch information
tintin10q committed Jan 26, 2024
1 parent 10307ec commit eeecb23
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ public void addModPanel(int modPos, int pos) throws IOException {
Name.setPreferredSize(new Dimension(150, 67));
Name.setMinimumSize(new Dimension(150, 67));
Name.setText(mod.getDisplay());
Name.setToolTipText(mod.getDescription());
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 0;
Expand All @@ -292,6 +293,7 @@ public void addModPanel(int modPos, int pos) throws IOException {
JLabel Image = new JLabel();
Image.setHorizontalAlignment(SwingConstants.LEFT);
Image.setHorizontalTextPosition(SwingConstants.TRAILING);
Image.setToolTipText(mod.getDescription());
BufferedImage icon;
if (mod.icon != null) {
if (new File(SkyclientUniversal.cache, mod.getIcon()).exists()) {
Expand Down Expand Up @@ -450,6 +452,7 @@ public void addPackPanel(int packPos, int pos) throws IOException {
Name.setPreferredSize(new Dimension(150, 67));
Name.setMinimumSize(new Dimension(150, 67));
Name.setText(pack.getDisplay());
Name.setToolTipText(pack.getDescription());
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 0;
Expand All @@ -458,6 +461,7 @@ public void addPackPanel(int packPos, int pos) throws IOException {
JLabel Image = new JLabel();
Image.setHorizontalAlignment(SwingConstants.LEFT);
Image.setHorizontalTextPosition(SwingConstants.TRAILING);
Image.setToolTipText(pack.getDescription());
BufferedImage icon;
if (new File(SkyclientUniversal.cache, pack.getIcon()).exists()) {
icon = resize(ImageIO.read(new File(SkyclientUniversal.cache, pack.getIcon())), 50, 50, Objects.equals(pack.icon_scaling, "pixel"));
Expand Down

0 comments on commit eeecb23

Please sign in to comment.