PIVX Core  5.6.99
P2P Digital Currency
addresslabelrow.cpp
Go to the documentation of this file.
1 // Copyright (c) 2019-2021 The PIVX Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include "addresslabelrow.h"
6 #include "ui_addresslabelrow.h"
7 
9  QWidget(parent),
10  ui(new Ui::AddressLabelRow)
11 {
12  ui->setupUi(this);
13  ui->lblAddress->setProperty("cssClass", "text-list-body1");
14  ui->lblLabel->setProperty("cssClass", "text-list-title1");
15 }
16 
17 void AddressLabelRow::init(bool isLightTheme, bool isHover)
18 {
19  updateState(isLightTheme, isHover, false);
20 }
21 
22 void AddressLabelRow::updateView(const QString& address, const QString& label)
23 {
24  ui->lblAddress->setText(address);
25  ui->lblLabel->setText(label);
26 }
27 
28 void AddressLabelRow::updateState(bool isLightTheme, bool isHovered, bool isSelected)
29 {
30  if (isLightTheme)
31  ui->lblDivisory->setStyleSheet("background-color:#bababa");
32  else
33  ui->lblDivisory->setStyleSheet("background-color:#40ffffff");
34 
35  ui->btnMenu->setVisible(isHovered);
36 }
37 
39 {
40  ui->btnMenu->setVisible(true);
41  update();
42 }
43 
45 {
46  ui->btnMenu->setVisible(false);
47  update();
48 }
49 
51 {
52  delete ui;
53 }
virtual void enterEvent(QEvent *)
void updateState(bool isLightTheme, bool isHovered, bool isSelected)
AddressLabelRow(QWidget *parent=nullptr)
void init(bool isLightTheme, bool isHover)
Ui::AddressLabelRow * ui
virtual void leaveEvent(QEvent *)
void updateView(const QString &address, const QString &label)
bool isLightTheme()
Definition: qtutils.cpp:210