GUI: fixed not working card popup near screen border, improved card popup for chat and choose dialogs;

This commit is contained in:
Oleg Agafonov 2023-11-25 17:27:59 +04:00
parent 7475ee922a
commit 63290d3ed6
8 changed files with 85 additions and 15 deletions

View file

@ -18,10 +18,16 @@ public class TransferData {
private Point locationOnScreen; // must contain REAL card location (e.g. without outer/draw spaces), so use getCardLocationOnScreen to update it
private int popupOffsetX;
private int popupOffsetY;
private PopupAutoLocationMode popupAutoLocationMode = PopupAutoLocationMode.PUT_INSIDE_PARENT;
private UUID gameId;
private CardView card;
private int tooltipDelay; // custom delay, set non-zero to overwrite preferences settings
public enum PopupAutoLocationMode {
PUT_INSIDE_PARENT,
PUT_NEAR_MOUSE_POSITION
}
/**
* If you use it with cards then call top layer panel like data.getComponent().getTopPanelRef()
*
@ -90,4 +96,12 @@ public class TransferData {
public void setTooltipDelay(int tooltipDelay) {
this.tooltipDelay = tooltipDelay;
}
public void setPopupAutoLocationMode(PopupAutoLocationMode mode) {
this.popupAutoLocationMode = mode;
}
public PopupAutoLocationMode getPopupAutoLocationMode() {
return this.popupAutoLocationMode;
}
}