diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-07-07 10:36:21 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-07-07 10:42:53 +0200 |
commit | 88ae36bc06d9c9458442242b12ee730dbe67cffc (patch) | |
tree | d209d06ef7fabaf64889806e7cb9785b93b97b4a /src | |
parent | 1132cdbff353838bd0f005dd6bf3967439afe8ed (diff) | |
parent | ad87bc4de10d8ff9934635f2a30078ccf531a124 (diff) |
Merge pull request #4466
ad87bc4 [Qt] Replace status bar unit icon with actual images (Cozz Lovan)
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.qt.include | 5 | ||||
-rw-r--r-- | src/qt/bitcoin.qrc | 3 | ||||
-rw-r--r-- | src/qt/bitcoingui.cpp | 3 | ||||
-rw-r--r-- | src/qt/bitcoinunits.cpp | 11 | ||||
-rw-r--r-- | src/qt/bitcoinunits.h | 2 | ||||
-rw-r--r-- | src/qt/res/icons/unit_btc.png | bin | 0 -> 2107 bytes | |||
-rw-r--r-- | src/qt/res/icons/unit_mbtc.png | bin | 0 -> 2107 bytes | |||
-rw-r--r-- | src/qt/res/icons/unit_ubtc.png | bin | 0 -> 2107 bytes |
8 files changed, 21 insertions, 3 deletions
diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index f2b6c2ccd6..d97c2d064a 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -252,7 +252,10 @@ RES_ICONS = \ qt/res/icons/tx_inout.png \ qt/res/icons/tx_input.png \ qt/res/icons/tx_output.png \ - qt/res/icons/tx_mined.png + qt/res/icons/tx_mined.png \ + qt/res/icons/unit_btc.png \ + qt/res/icons/unit_mbtc.png \ + qt/res/icons/unit_ubtc.png BITCOIN_QT_CPP = \ qt/bitcoinaddressvalidator.cpp \ diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index f38200c7f7..357c6470d3 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -35,6 +35,9 @@ <file alias="tx_input">res/icons/tx_input.png</file> <file alias="tx_output">res/icons/tx_output.png</file> <file alias="tx_inout">res/icons/tx_inout.png</file> + <file alias="unit_btc">res/icons/unit_btc.png</file> + <file alias="unit_mbtc">res/icons/unit_mbtc.png</file> + <file alias="unit_ubtc">res/icons/unit_ubtc.png</file> <file alias="lock_closed">res/icons/lock_closed.png</file> <file alias="lock_open">res/icons/lock_open.png</file> <file alias="key">res/icons/key.png</file> diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index b45d861b87..6b3aa2a2df 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -1009,7 +1009,6 @@ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl():QLabel() { optionsModel = 0; createContextMenu(); - setStyleSheet("font:11pt; color: #333333"); setToolTip(tr("Unit to show amounts in. Click to select another unit.")); } @@ -1054,7 +1053,7 @@ void UnitDisplayStatusBarControl::setOptionsModel(OptionsModel *optionsModel) /** When Display Units are changed on OptionsModel it will refresh the display text of the control on the status bar */ void UnitDisplayStatusBarControl::updateDisplayUnit(int newUnits) { - setText(BitcoinUnits::name(newUnits)); + setPixmap(QIcon(":/icons/unit_" + BitcoinUnits::id(newUnits)).pixmap(31,STATUSBAR_ICONSIZE)); } /** Shows context menu with Display Unit options by the mouse coordinates */ diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 4ba6aba551..bbc9b2e5af 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -34,6 +34,17 @@ bool BitcoinUnits::valid(int unit) } } +QString BitcoinUnits::id(int unit) +{ + switch(unit) + { + case BTC: return QString("btc"); + case mBTC: return QString("mbtc"); + case uBTC: return QString("ubtc"); + default: return QString("???"); + } +} + QString BitcoinUnits::name(int unit) { switch(unit) diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index 451b52ee21..da34ed8976 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -36,6 +36,8 @@ public: static QList<Unit> availableUnits(); //! Is unit ID valid? static bool valid(int unit); + //! Identifier, e.g. for image names + static QString id(int unit); //! Short name static QString name(int unit); //! Longer description diff --git a/src/qt/res/icons/unit_btc.png b/src/qt/res/icons/unit_btc.png Binary files differnew file mode 100644 index 0000000000..ec3497435c --- /dev/null +++ b/src/qt/res/icons/unit_btc.png diff --git a/src/qt/res/icons/unit_mbtc.png b/src/qt/res/icons/unit_mbtc.png Binary files differnew file mode 100644 index 0000000000..32bf2f2ca0 --- /dev/null +++ b/src/qt/res/icons/unit_mbtc.png diff --git a/src/qt/res/icons/unit_ubtc.png b/src/qt/res/icons/unit_ubtc.png Binary files differnew file mode 100644 index 0000000000..d5a154882b --- /dev/null +++ b/src/qt/res/icons/unit_ubtc.png |