12 #include <QGraphicsDropShadowEffect>
25 widget->setWindowFlags(Qt::CustomizeWindowHint);
26 widget->setAttribute(Qt::WA_TranslucentBackground,
true);
27 QPropertyAnimation* animation =
new QPropertyAnimation(widget,
"pos");
28 animation->setDuration(300);
29 animation->setStartValue(QPoint(0, gui->height()));
30 animation->setEndValue(QPoint(0, gui->height() - widget->height()));
31 animation->setEasingCurve(QEasingCurve::OutQuad);
32 animation->start(QAbstractAnimation::DeleteWhenStopped);
33 widget->activateWindow();
35 return widget->exec();
40 widget->setWindowFlags(Qt::CustomizeWindowHint);
41 widget->setAttribute(Qt::WA_TranslucentBackground,
true);
42 QPropertyAnimation* animation =
new QPropertyAnimation(widget,
"pos");
43 animation->setDuration(300);
44 animation->setStartValue(widget->pos());
45 animation->setEndValue(QPoint(0, gui->height() + 100));
46 animation->setEasingCurve(QEasingCurve::OutQuad);
47 animation->start(QAbstractAnimation::DeleteWhenStopped);
52 dialog->setWindowFlags(Qt::CustomizeWindowHint);
55 dialog->activateWindow();
56 dialog->resize(parent->width(), parent->height());
61 widget->setWindowFlags(Qt::CustomizeWindowHint);
62 widget->setAttribute(Qt::WA_TranslucentBackground,
true);
63 QPropertyAnimation* animation =
new QPropertyAnimation(widget,
"pos");
64 animation->setDuration(300);
65 int xPos = gui->width() / posX;
66 animation->setStartValue(QPoint(xPos, gui->height()));
67 animation->setEndValue(QPoint(xPos, gui->height() / posY));
68 animation->setEasingCurve(QEasingCurve::OutQuad);
69 animation->start(QAbstractAnimation::DeleteWhenStopped);
70 widget->activateWindow();
71 bool res = widget->exec();
72 if (hideOpaqueBackground) gui->
showHide(
false);
83 widget->setWindowFlags(Qt::CustomizeWindowHint);
84 widget->setAttribute(Qt::WA_TranslucentBackground,
true);
86 widget->activateWindow();
87 widget->resize(gui->width(), gui->height());
89 QPropertyAnimation* animation =
new QPropertyAnimation(widget,
"pos");
90 animation->setDuration(300);
92 animation->setStartValue(QPoint(xPos, gui->height()));
93 animation->setEndValue(QPoint(xPos, 0));
94 animation->setEasingCurve(QEasingCurve::OutQuad);
95 animation->start(QAbstractAnimation::DeleteWhenStopped);
96 widget->activateWindow();
97 bool res = widget->exec();
102 QPixmap
encodeToQr(
const QString& str, QString& errorStr,
const QColor& qrColor)
104 if (!str.isEmpty()) {
106 if (str.length() > MAX_URI_LENGTH) {
107 errorStr =
"Resulting URI too long, try to reduce the text for label / message.";
110 QRcode* code = QRcode_encodeString(str.toUtf8().constData(), 0, QR_ECLEVEL_L, QR_MODE_8, 1);
112 errorStr =
"Error encoding URI into QR Code.";
115 QImage myImage = QImage(code->width + 2, code->width + 2, QImage::Format_RGB32);
116 myImage.fill(0xffffff);
117 unsigned char* p = code->data;
118 for (
int y = 0; y < code->width; y++) {
119 for (
int x = 0; x < code->width; x++) {
120 myImage.setPixel(x + 1, y + 1, ((*p & 1) ? qrColor.rgb() : 0xffffff));
125 return QPixmap::fromImage(myImage);
134 filter->addItem(QObject::tr(
"All"),
"");
159 filter->addItem(QObject::tr(
"Received"),
164 filter->addItem(QObject::tr(
"Sent"),
169 filter->addItem(QObject::tr(
"Shield"),
192 if (!
settings->contains(
"lightTheme")) {
193 settings->setValue(
"lightTheme",
true);
212 return getSettings()->value(
"lightTheme",
true).toBool();
218 settings->setValue(
"theme", isLight ?
"default" :
"default-dark");
219 settings->setValue(
"lightTheme", isLight);
227 widget->style()->unpolish(widget);
228 widget->style()->polish(widget);
236 return QColor(
"#25b088ff");
237 }
else if (isHovered) {
238 return QColor(
"#25bababa");
240 return isLightTheme ? QColor(
"#ffffff") : QColor(
"#0f0b16");
244 void initComboBox(QComboBox* combo, QLineEdit* lineEdit, QString cssClass,
bool setView)
247 combo->setEditable(
true);
249 lineEdit->setReadOnly(
true);
250 lineEdit->setAlignment(Qt::AlignRight);
251 combo->setLineEdit(lineEdit);
253 combo->setStyleSheet(
"selection-background-color:transparent;");
254 if (setView) combo->setView(
new QListView());
264 boxType->setCurrentIndex(0);
267 boxOrder->addItem(
"asc", Qt::AscendingOrder);
268 boxOrder->addItem(
"desc", Qt::DescendingOrder);
269 boxOrder->setCurrentIndex(0);
279 edit->setAttribute(Qt::WA_MacShowFocusRect,
false);
284 setCssProperty(edit, isValid ?
"edit-primary" :
"edit-primary-error", forceUpdate);
289 setCssProperty(edit, isValid ?
"edit-primary-dialog" :
"edit-primary-dialog-error", forceUpdate);
294 QGraphicsDropShadowEffect* shadowEffect =
new QGraphicsDropShadowEffect();
295 shadowEffect->setColor(QColor(0, 0, 0, 22));
296 shadowEffect->setXOffset(0);
297 shadowEffect->setYOffset(3);
298 shadowEffect->setBlurRadius(6);
299 edit->setGraphicsEffect(shadowEffect);
314 for (QWidget* w : args) {
336 for (QWidget* w : args) {
343 if (wid->property(
"cssClass") == value)
return;
344 wid->setProperty(
"cssClass", value);
356 for (QWidget* w : args) {
static const QString Delegator
Specifies cold staking addresses which delegated tokens to this wallet and ARE being staked.
static const QString ColdStakingSend
Specifies send cold staking addresses (simil 'contacts')
static const QString ShieldedSend
Specifies shielded receive address.
@ Address
Bitcoin address.
@ Label
User specified label.
@ Date
Address creation date.
static const QString ShieldedReceive
Specifies shielded send address.
static const QString Send
Specifies send address.
static const QString Delegable
Specifies cold staking addresses which delegated tokens to this wallet.
static const QString Receive
Specifies receive address.
static const QString ColdStaking
Specifies cold staking own addresses.
static const quint32 ALL_TYPES
Type filter bit field (all types)
static quint32 TYPE(int type)
@ RecvWithShieldedAddress
@ SendToSelfShieldToTransparent
@ P2CSDelegationSentOwner
@ SendToSelfShieldedAddress
@ RecvWithShieldedAddressMemo
@ SendToSelfShieldToShieldChangeAddress
void forceUpdateStyle(QWidget *widget, bool forceUpdate)
void initComboBox(QComboBox *combo, QLineEdit *lineEdit, QString cssClass, bool setView)
void setFilterAddressBook(QComboBox *filter, SortEdit *lineEdit)
void setupSettings(QSettings *settings)
void openDialogFullScreen(QWidget *parent, QWidget *dialog)
void closeDialog(QDialog *widget, PIVXGUI *gui)
QSettings * getSettings()
void setCssTextBodyDialog(std::initializer_list< QWidget * > args)
bool openDialogWithOpaqueBackgroundFullScreen(QDialog *widget, PIVXGUI *gui)
void setCssEditLineDialog(QLineEdit *edit, bool isValid, bool forceUpdate)
bool openDialogWithOpaqueBackgroundY(QDialog *widget, PIVXGUI *gui, double posX, int posY, bool hideOpaqueBackground)
void setCssTitleScreen(QLabel *label)
void initCssEditLine(QLineEdit *edit, bool isDialog)
bool openDialogWithOpaqueBackground(QDialog *widget, PIVXGUI *gui, double posX)
void setSortTxTypeFilter(QComboBox *filter, SortEdit *lineEditType)
void setShadow(QWidget *edit)
void setCssProperty(std::initializer_list< QWidget * > args, const QString &value)
QColor getRowColor(bool isLightTheme, bool isHovered, bool isSelected)
void setCssSubtitleScreen(QWidget *wid)
QPixmap encodeToQr(const QString &str, QString &errorStr, const QColor &qrColor)
void setCssBtnPrimary(QPushButton *btn, bool forceUpdate)
void setSortTx(QComboBox *filter, SortEdit *lineEdit)
bool openDialog(QDialog *widget, QWidget *gui)
void setCssEditLine(QLineEdit *edit, bool isValid, bool forceUpdate)
void setCssBtnSecondary(QPushButton *btn, bool forceUpdate)
void fillAddressSortControls(SortEdit *seType, SortEdit *seOrder, QComboBox *boxType, QComboBox *boxOrder)
void updateStyle(QWidget *widget)
void setTheme(bool isLight)