Restore Plugin Toolbar Button Tooltips (#2833)
* Always set button tooltips * Completely remove name property and replace it with tooltips * Make tooltips final
This commit is contained in:
@@ -76,7 +76,7 @@ public class ConfigPlugin extends Plugin
|
||||
}
|
||||
|
||||
navButton = NavigationButton.builder()
|
||||
.name("Configuration")
|
||||
.tooltip("Configuration")
|
||||
.icon(icon)
|
||||
.priority(0)
|
||||
.panel(configPanel)
|
||||
|
||||
@@ -120,7 +120,7 @@ public class DevToolsPlugin extends Plugin
|
||||
}
|
||||
|
||||
navButton = NavigationButton.builder()
|
||||
.name("Developer Tools")
|
||||
.tooltip("Developer Tools")
|
||||
.icon(icon)
|
||||
.priority(1)
|
||||
.panel(panel)
|
||||
|
||||
@@ -95,7 +95,7 @@ public class FarmingTrackerPlugin extends Plugin
|
||||
panel = new FarmingTrackerPanel(client, itemManager, configManager, config, farmingWorld);
|
||||
|
||||
navButton = NavigationButton.builder()
|
||||
.name("Farming Tracker")
|
||||
.tooltip("Farming Tracker")
|
||||
.icon(icon)
|
||||
.panel(panel)
|
||||
.priority(4)
|
||||
|
||||
@@ -91,7 +91,7 @@ public class FeedPlugin extends Plugin
|
||||
}
|
||||
|
||||
navButton = NavigationButton.builder()
|
||||
.name("News Feed")
|
||||
.tooltip("News Feed")
|
||||
.icon(icon)
|
||||
.priority(8)
|
||||
.panel(feedPanel)
|
||||
|
||||
@@ -112,7 +112,7 @@ public class GrandExchangePlugin extends Plugin
|
||||
}
|
||||
|
||||
button = NavigationButton.builder()
|
||||
.name("GE Offers")
|
||||
.tooltip("GE Offers")
|
||||
.icon(icon)
|
||||
.priority(3)
|
||||
.panel(panel)
|
||||
|
||||
@@ -102,7 +102,7 @@ public class HiscorePlugin extends Plugin
|
||||
}
|
||||
|
||||
navButton = NavigationButton.builder()
|
||||
.name("Hiscore")
|
||||
.tooltip("Hiscore")
|
||||
.icon(icon)
|
||||
.priority(5)
|
||||
.panel(hiscorePanel)
|
||||
|
||||
@@ -56,7 +56,7 @@ public class InfoPlugin extends Plugin
|
||||
}
|
||||
|
||||
navButton = NavigationButton.builder()
|
||||
.name("Info")
|
||||
.tooltip("Info")
|
||||
.icon(icon)
|
||||
.priority(9)
|
||||
.panel(panel)
|
||||
|
||||
@@ -93,7 +93,7 @@ public class KourendLibraryPlugin extends Plugin
|
||||
}
|
||||
|
||||
navButton = NavigationButton.builder()
|
||||
.name("Kourend Library")
|
||||
.tooltip("Kourend Library")
|
||||
.priority(6)
|
||||
.icon(icon)
|
||||
.panel(panel)
|
||||
|
||||
@@ -72,7 +72,7 @@ public class NotesPlugin extends Plugin
|
||||
}
|
||||
|
||||
navButton = NavigationButton.builder()
|
||||
.name("Notes")
|
||||
.tooltip("Notes")
|
||||
.icon(icon)
|
||||
.priority(7)
|
||||
.panel(panel)
|
||||
|
||||
@@ -76,7 +76,7 @@ public class SkillCalculatorPlugin extends Plugin
|
||||
|
||||
uiPanel = new SkillCalculatorPanel(skillIconManager, client);
|
||||
uiNavigationButton = NavigationButton.builder()
|
||||
.name("Skill Calculator")
|
||||
.tooltip("Skill Calculator")
|
||||
.icon(icon)
|
||||
.priority(6)
|
||||
.panel(uiPanel)
|
||||
|
||||
@@ -120,7 +120,7 @@ public class XpTrackerPlugin extends Plugin
|
||||
}
|
||||
|
||||
navButton = NavigationButton.builder()
|
||||
.name("XP Tracker")
|
||||
.tooltip("XP Tracker")
|
||||
.icon(icon)
|
||||
.priority(2)
|
||||
.panel(xpPanel)
|
||||
|
||||
@@ -36,14 +36,9 @@ import lombok.EqualsAndHashCode;
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@EqualsAndHashCode(of = {"name", "tooltip"})
|
||||
@EqualsAndHashCode(of = {"tooltip"})
|
||||
public class NavigationButton
|
||||
{
|
||||
/**
|
||||
* Button name.
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* Icon of button.
|
||||
*/
|
||||
@@ -52,7 +47,7 @@ public class NavigationButton
|
||||
/**
|
||||
* Tooltip to show when hovered.
|
||||
*/
|
||||
private String tooltip;
|
||||
private final String tooltip;
|
||||
|
||||
/**
|
||||
* Button selection state
|
||||
|
||||
@@ -42,7 +42,7 @@ public class PluginToolbar
|
||||
private final TreeSet<NavigationButton> buttons = new TreeSet<>((a, b) ->
|
||||
ComparisonChain.start()
|
||||
.compare(a.getPriority(), b.getPriority())
|
||||
.compare(a.getName(), b.getName())
|
||||
.compare(a.getTooltip(), b.getTooltip())
|
||||
.result());
|
||||
|
||||
@Inject
|
||||
|
||||
@@ -311,7 +311,6 @@ public class SwingUtil
|
||||
|
||||
final JButton button = new JButton();
|
||||
button.setMaximumSize(new Dimension(30, 30));
|
||||
button.setName(navigationButton.getName());
|
||||
button.setToolTipText(navigationButton.getTooltip());
|
||||
button.setIcon(new ImageIcon(scaledImage));
|
||||
button.putClientProperty(SubstanceSynapse.FLAT_LOOK, Boolean.TRUE);
|
||||
|
||||
Reference in New Issue
Block a user