UI: increased tooltip time before hide (60 secs)

This commit is contained in:
Oleg Agafonov 2018-01-02 00:15:44 +04:00
parent c1bf846973
commit 9009d72c82
3 changed files with 11 additions and 5 deletions

View file

@ -50,6 +50,7 @@ import mage.client.chat.ChatPanelBasic;
import mage.client.components.*;
import mage.client.components.ext.dlg.DialogManager;
import mage.client.components.tray.MageTray;
import mage.client.constants.Constants;
import mage.client.constants.Constants.DeckEditorMode;
import mage.client.deckeditor.DeckEditorPane;
import mage.client.deckeditor.collection.viewer.CollectionViewerPane;
@ -92,8 +93,6 @@ import org.mage.plugins.card.images.DownloadPictures;
import org.mage.plugins.card.info.CardInfoPaneImpl;
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
import static org.mage.plugins.card.utils.CardImageUtils.getImagesDir;
/**
* @author BetaSteward_at_googlemail.com
*/
@ -285,6 +284,9 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
balloonTip.setPositioner(new LeftAbovePositioner(0, 0));
balloonTip.setVisible(false);
// tooltips delay in ms
ToolTipManager.sharedInstance().setDismissDelay(Constants.TOOLTIPS_DELAY_MS);
mageToolbar.add(createSwitchPanelsButton(), 0);
mageToolbar.add(new javax.swing.JToolBar.Separator(), 1);

View file

@ -69,6 +69,9 @@ public final class Constants {
public static final int POWBOX_TEXT_MAX_LEFT = 212;
public static final int DAMAGE_MAX_LEFT = 180;
// tooltip hints delay in ms (need more time to display long hints withour hiding)
public static final int TOOLTIPS_DELAY_MS = 60 * 1000;
public static final Border EMPTY_BORDER = BorderFactory.createEmptyBorder(2, 2, 2, 2);
public static final double SCALE_FACTOR = 0.5;

View file

@ -51,7 +51,9 @@ import javax.swing.UIManager;
import mage.client.SessionHandler;
import mage.client.components.MageTextArea;
import mage.client.constants.Constants;
import mage.client.game.FeedbackPanel.FeedbackMode;
import static mage.client.game.FeedbackPanel.FeedbackMode.QUESTION;
import mage.client.util.GUISizeHelper;
import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_ID_NO;
@ -82,7 +84,6 @@ public class HelperPanel extends JPanel {
private javax.swing.JButton linkSpecial;
private javax.swing.JButton linkUndo;
private final int defaultDismissTimeout = ToolTipManager.sharedInstance().getDismissDelay();
private final Object tooltipBackground = UIManager.get("info");
private static final String CMD_AUTO_ANSWER_ID_YES = "cmdAutoAnswerIdYes";
@ -232,13 +233,13 @@ public class HelperPanel extends JPanel {
@Override
public void mouseEntered(MouseEvent me) {
ToolTipManager.sharedInstance().setDismissDelay(100000);
ToolTipManager.sharedInstance().setDismissDelay(100 * 1000);
UIManager.put("info", Color.DARK_GRAY);
}
@Override
public void mouseExited(MouseEvent me) {
ToolTipManager.sharedInstance().setDismissDelay(defaultDismissTimeout);
ToolTipManager.sharedInstance().setDismissDelay(Constants.TOOLTIPS_DELAY_MS);
UIManager.put("info", tooltipBackground);
}
});