6 #include "ui_balancebubble.h"
10 #include <QGraphicsOpacityEffect>
11 #include <QPropertyAnimation>
21 ui->frame->setProperty(
"cssClass",
"container-popup");
24 std::initializer_list<QWidget*> lblTitles = {
ui->lblFirst,
ui->lblSecond};
27 font.setWeight(QFont::Light);
28 for (QWidget* w : lblTitles) { w->setFont(font); }
34 valueTrans = valueTrans.replace(QChar(
THIN_SP_CP), QString(
","));
36 valueShield = valueShield.replace(QChar(
THIN_SP_CP), QString(
","));
38 ui->textTransparent->setText(valueTrans);
39 ui->textShielded->setText(valueShield);
45 QGraphicsOpacityEffect *eff =
new QGraphicsOpacityEffect(
this);
46 this->setGraphicsEffect(eff);
47 QPropertyAnimation *anim =
new QPropertyAnimation(eff,
"opacity");
48 anim->setDuration(400);
49 anim->setStartValue(0);
51 anim->setEasingCurve(QEasingCurve::Linear);
52 anim->start(QPropertyAnimation::DeleteWhenStopped);
62 QGraphicsOpacityEffect *eff =
new QGraphicsOpacityEffect(
this);
63 this->setGraphicsEffect(eff);
64 QPropertyAnimation *a =
new QPropertyAnimation(eff,
"opacity");
68 a->setEasingCurve(QEasingCurve::OutBack);
69 a->start(QPropertyAnimation::DeleteWhenStopped);
virtual void hideEvent(QHideEvent *event) override
void updateValues(int64_t nTransparentBalance, int64_t nShieldedBalance, int unit)
virtual void showEvent(QShowEvent *event) override
BalanceBubble(QWidget *parent=nullptr)
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)
void setCssProperty(std::initializer_list< QWidget * > args, const QString &value)