Fabcoin Core  0.16.2
P2P Digital Currency
titlebar.cpp
Go to the documentation of this file.
1 #include <titlebar.h>
2 #include <ui_titlebar.h>
3 #include <fabcoinunits.h>
4 #include <optionsmodel.h>
5 #include <tabbarinfo.h>
6 
7 #include <QPixmap>
8 #include <platformstyle.h>
9 
10 namespace TitleBar_NS {
11 const int titleHeight = 35;
12 }
13 using namespace TitleBar_NS;
14 
15 TitleBar::TitleBar(const PlatformStyle *platformStyle, QWidget *parent) :
16  QWidget(parent),
17  ui(new Ui::TitleBar),
18  m_tab(0)
19 {
20  ui->setupUi(this);
21  // Set size policy
22  setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
23  ui->tabWidget->setDrawBase(false);
24  ui->tabWidget->setTabsClosable(true);
25  setFixedHeight(titleHeight);
26  m_iconCloseTab = platformStyle->TextColorIcon(":/icons/quit");
27 }
28 
30 {
31  delete ui;
32 }
33 
35 {
36  this->model = _model;
37 
40 
42 }
43 
44 void TitleBar::setTabBarInfo(QObject *info)
45 {
46  if(m_tab)
47  {
48  m_tab->detach();
49  }
50 
51  if(info && info->inherits("TabBarInfo"))
52  {
53  TabBarInfo* tab = (TabBarInfo*)info;
54  m_tab = tab;
56  }
57 }
58 
59 void TitleBar::setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& stake,
60  const CAmount& watchBalance, const CAmount& watchUnconfirmedBalance, const CAmount& watchImmatureBalance, const CAmount& watchStake)
61 {
62  Q_UNUSED(unconfirmedBalance);
63  Q_UNUSED(immatureBalance);
64  Q_UNUSED(watchBalance);
65  Q_UNUSED(stake);
66  Q_UNUSED(watchUnconfirmedBalance);
67  Q_UNUSED(watchImmatureBalance);
68  Q_UNUSED(watchStake);
69 
70  if(model && model->getOptionsModel())
71  {
73  }
74 }
75 
76 void TitleBar::on_navigationResized(const QSize &_size)
77 {
78  ui->widgetLogo->setFixedWidth(_size.width());
79 }
void setBalance(const CAmount &balance, const CAmount &unconfirmedBalance, const CAmount &immatureBalance, const CAmount &stake, const CAmount &watchBalance, const CAmount &watchUnconfirmedBalance, const CAmount &watchImmatureBalance, const CAmount &watchStake)
setBalance Slot for changing the balance
Definition: titlebar.cpp:59
struct evm_uint256be balance(struct evm_env *env, struct evm_uint160be address)
Definition: capi.c:7
QTabBar * tabWidget
Definition: ui_titlebar.h:36
TitleBar(const PlatformStyle *platformStyle, QWidget *parent=0)
TitleBar Constructor.
Definition: titlebar.cpp:15
void setTabBarInfo(QObject *info)
setTabBarInfo Set the tab bar info
Definition: titlebar.cpp:44
WalletModel * model
Definition: titlebar.h:64
TabBarInfo * m_tab
Definition: titlebar.h:65
void attach(QTabBar *tabBar, QIcon *iconCloseTab)
attach Attack the tab bar
Definition: tabbarinfo.cpp:68
CAmount getUnconfirmedBalance() const
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)
int64_t CAmount
Amount in lius (Can be negative)
Definition: amount.h:15
CAmount getWatchBalance() const
void detach()
detach Detach the tab bar
Definition: tabbarinfo.cpp:80
const int titleHeight
Definition: titlebar.cpp:11
QIcon m_iconCloseTab
Definition: titlebar.h:66
The TitleBar class Title bar widget.
Definition: titlebar.h:20
QLabel * lblBalance
Definition: ui_titlebar.h:39
void setupUi(QWidget *TitleBar)
Definition: ui_titlebar.h:41
int getDisplayUnit()
Definition: optionsmodel.h:70
Ui::TitleBar * ui
Definition: titlebar.h:63
CAmount getWatchImmatureBalance() const
CAmount getStake() const
Definition: walletmodel.cpp:95
Interface to Fabcoin wallet from Qt view code.
Definition: walletmodel.h:103
CAmount getWatchStake() const
The TabBarInfo class Class for informations about tabs.
Definition: tabbarinfo.h:13
QWidget * widgetLogo
Definition: ui_titlebar.h:30
CAmount getImmatureBalance() const
~TitleBar()
TitleBar Destrustor.
Definition: titlebar.cpp:29
void on_navigationResized(const QSize &_size)
on_navigationResized Slot for changing the size of the navigation bar
Definition: titlebar.cpp:76
void setModel(WalletModel *_model)
setModel Set wallet model
Definition: titlebar.cpp:34
CAmount getWatchUnconfirmedBalance() const
CAmount getBalance(const CCoinControl *coinControl=nullptr) const
Definition: walletmodel.cpp:86
OptionsModel * getOptionsModel()
QIcon TextColorIcon(const QString &filename) const
Colorize an icon (given filename) with the text color.