Merge remote-tracking branch 'origin/GP-1-dragonmacher-tooltip-fix--SQUASHED'

This commit is contained in:
Ryan Kurtz 2025-08-19 10:00:01 -04:00
commit c7b125b1c7
3 changed files with 55 additions and 8 deletions

View file

@ -124,6 +124,8 @@ public class DockingUtils {
private static final KeyStroke REDO_KEYSTROKE =
KeyStroke.getKeyStroke(KeyEvent.VK_Y, CONTROL_KEY_MODIFIER_MASK);
private static boolean globalTooltipsEnabled = true;
public static JSeparator createToolbarSeparator() {
Dimension sepDim = new Dimension(2, ICON_SIZE + 2);
JSeparator separator = new JSeparator(SwingConstants.VERTICAL);
@ -355,19 +357,36 @@ public class DockingUtils {
}
/**
* Sets the application-wide Java tooltip enablement.
* @param enabled true if enabled; false prevents all Java tooltips
* Not meant for public consumption. This is for application code to control tooltips on
* behalf of the user.
* @param enabled true if enabled
*/
public static void setTipWindowEnabled(boolean enabled) {
public static void setGlobalTooltipEnabledOption(boolean enabled) {
globalTooltipsEnabled = enabled;
Swing.runLater(() -> ToolTipManager.sharedInstance().setEnabled(enabled));
}
/**
* Note: calling this method has no effect
* @param enabled true if enabled; false prevents all Java tooltips
* @deprecated this method is not longer supported; controlling application tooltips should be
* done through tool options in the UI
*/
@Deprecated(forRemoval = true, since = "12")
public static void setTipWindowEnabled(boolean enabled) {
// no-op
}
/**
* Returns true if application-wide Java tooltips are enabled.
* @return true if application-wide Java tooltips are enabled.
*/
public static boolean isTipWindowEnabled() {
return Swing.runNow(() -> ToolTipManager.sharedInstance().isEnabled());
// Note: using this call would allow for client code to control tooltip enablement. We use
// tool options to control enablement, which is reflected in the boolean used below.
// return Swing.runNow(() -> ToolTipManager.sharedInstance().isEnabled());
return globalTooltipsEnabled;
}
/** Hides any open tooltip window */