mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
GUI: improved stability of popup hint window (fixed game freeze in some use cases, fixes #11595)
This commit is contained in:
parent
35334f50b6
commit
7bda2d95d2
1 changed files with 12 additions and 6 deletions
|
|
@ -59,7 +59,7 @@ public class MageEditorPane extends JEditorPane {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cleanUp() {
|
public void cleanUp() {
|
||||||
resetCursor();
|
setCursorToDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addHyperlinkHandlers() {
|
private void addHyperlinkHandlers() {
|
||||||
|
|
@ -171,17 +171,23 @@ public class MageEditorPane extends JEditorPane {
|
||||||
@Override
|
@Override
|
||||||
public void mouseExited(MouseEvent e) {
|
public void mouseExited(MouseEvent e) {
|
||||||
cardInfo.onMouseExited();
|
cardInfo.onMouseExited();
|
||||||
resetCursor();
|
setCursorToDefault();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetCursor() {
|
private void setCursorToDefault() {
|
||||||
SwingUtilities.windowForComponent(this).setCursor(Cursor.getDefaultCursor());
|
Window parent = SwingUtilities.windowForComponent(this);
|
||||||
|
if (parent != null) {
|
||||||
|
parent.setCursor(Cursor.getDefaultCursor());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setCursorToHand() {
|
private void setCursorToHand() {
|
||||||
SwingUtilities.windowForComponent(this).setCursor(new Cursor(Cursor.HAND_CURSOR));
|
Window parent = SwingUtilities.windowForComponent(this);
|
||||||
|
if (parent != null) {
|
||||||
|
parent.setCursor(new Cursor(Cursor.HAND_CURSOR));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void urlHighlightEnable(Element hyperlinkElement) {
|
private void urlHighlightEnable(Element hyperlinkElement) {
|
||||||
|
|
@ -197,7 +203,7 @@ public class MageEditorPane extends JEditorPane {
|
||||||
changeUrlTextDecoration(lastUrlElementEntered, "none");
|
changeUrlTextDecoration(lastUrlElementEntered, "none");
|
||||||
lastUrlElementEntered = null;
|
lastUrlElementEntered = null;
|
||||||
}
|
}
|
||||||
resetCursor();
|
setCursorToDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeUrlTextDecoration(Element el, String decoration) {
|
private void changeUrlTextDecoration(Element el, String decoration) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue