mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Add max allowed message option to Popup and increase window size for Monero to improve readability
This commit is contained in:
parent
1d813c347c
commit
fa39258d71
@ -43,6 +43,7 @@ import bisq.core.util.validation.InputValidator;
|
||||
|
||||
import bisq.asset.AltCoinAccountDisclaimer;
|
||||
import bisq.asset.Asset;
|
||||
import bisq.asset.coins.Monero;
|
||||
|
||||
import bisq.common.util.Tuple2;
|
||||
import bisq.common.util.Tuple3;
|
||||
@ -138,7 +139,10 @@ public class AltCoinAccountsView extends PaymentAccountsView<GridPane, AltCoinAc
|
||||
if (asset.isPresent()) {
|
||||
final AltCoinAccountDisclaimer disclaimerAnnotation = asset.get().getClass().getAnnotation(AltCoinAccountDisclaimer.class);
|
||||
if (disclaimerAnnotation != null) {
|
||||
new Popup<>().information(Res.get(disclaimerAnnotation.value()))
|
||||
new Popup<>()
|
||||
.width(asset.get() instanceof Monero ? 1000 : 669)
|
||||
.maxMessageLength(2500)
|
||||
.information(Res.get(disclaimerAnnotation.value()))
|
||||
.useIUnderstandButton()
|
||||
.show();
|
||||
}
|
||||
|
@ -183,6 +183,8 @@ public abstract class Overlay<T extends Overlay> {
|
||||
protected Timer centerTime;
|
||||
protected Type type = Type.Undefined;
|
||||
|
||||
protected int maxChar = 1800;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Public API
|
||||
@ -460,6 +462,11 @@ public abstract class Overlay<T extends Overlay> {
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
public T maxMessageLength(int maxChar) {
|
||||
this.maxChar = maxChar;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
public T showBusyAnimation() {
|
||||
this.showBusyAnimation = true;
|
||||
//noinspection unchecked
|
||||
@ -984,8 +991,8 @@ public abstract class Overlay<T extends Overlay> {
|
||||
}
|
||||
|
||||
protected void setTruncatedMessage() {
|
||||
if (message != null && message.length() > 1800)
|
||||
truncatedMessage = StringUtils.abbreviate(message, 1800);
|
||||
if (message != null && message.length() > maxChar)
|
||||
truncatedMessage = StringUtils.abbreviate(message, maxChar);
|
||||
else truncatedMessage = Objects.requireNonNullElse(message, "");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user