Skip to content

Commit

Permalink
Use platformStyle to color the Send page icons & also to hide the ico…
Browse files Browse the repository at this point in the history
…ns on OSX
  • Loading branch information
zathras-crypto committed May 25, 2017
1 parent 05c16fd commit d121954
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
21 changes: 15 additions & 6 deletions src/qt/sendmpdialog.cpp
Expand Up @@ -10,6 +10,8 @@
#include "clientmodel.h"
#include "walletmodel.h"

#include "platformstyle.h"

#include "omnicore/createpayload.h"
#include "omnicore/errors.h"
#include "omnicore/omnicore.h"
Expand Down Expand Up @@ -45,18 +47,25 @@ using std::string;

using namespace mastercore;

SendMPDialog::SendMPDialog(QWidget *parent) :
SendMPDialog::SendMPDialog(const PlatformStyle *platformStyle, QWidget *parent) :
QDialog(parent),
ui(new Ui::SendMPDialog),
clientModel(0),
walletModel(0)
walletModel(0),
platformStyle(platformStyle)
{
ui->setupUi(this);

#ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac
ui->clearButton->setIcon(QIcon());
ui->sendButton->setIcon(QIcon());
#endif
// Use platformStyle instead of ifdef Q_OS_MAC to hide icons on Mac
if (!platformStyle->getImagesOnButtons()) {
ui->clearButton->setIcon(QIcon());
ui->sendButton->setIcon(QIcon());
} else {
// Use platformStyle to color the icons to match the rest of the UI
ui->clearButton->setIcon(platformStyle->SingleColorIcon(":/icons/remove"));
ui->sendButton->setIcon(platformStyle->SingleColorIcon(":/icons/send"));
}

#if QT_VERSION >= 0x040700 // populate placeholder text
ui->sendToLineEdit->setPlaceholderText("Enter an Omni Layer address (e.g. 1oMn1LaYeRADDreSShef77z6A5S4P)");
ui->amountLineEdit->setPlaceholderText("Enter Amount");
Expand Down
3 changes: 2 additions & 1 deletion src/qt/sendmpdialog.h
Expand Up @@ -26,7 +26,7 @@ class SendMPDialog : public QDialog
Q_OBJECT

public:
explicit SendMPDialog(QWidget *parent = 0);
explicit SendMPDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
~SendMPDialog();

void setClientModel(ClientModel *model);
Expand All @@ -49,6 +49,7 @@ public Q_SLOTS:
Ui::SendMPDialog *ui;
ClientModel *clientModel;
WalletModel *walletModel;
const PlatformStyle *platformStyle;

Q_SIGNALS:
// Fired when a message should be reported to the user
Expand Down
2 changes: 1 addition & 1 deletion src/qt/walletview.cpp
Expand Up @@ -86,7 +86,7 @@ WalletView::WalletView(const PlatformStyle *platformStyle, QWidget *parent):
sendCoinsPage = new QWidget(this);
QVBoxLayout *svbox = new QVBoxLayout();
sendCoinsTab = new SendCoinsDialog(platformStyle);
sendMPTab = new SendMPDialog();
sendMPTab = new SendMPDialog(platformStyle);
sendTabHolder = new QTabWidget();
sendTabHolder->addTab(sendMPTab,tr("Omni Layer"));
sendTabHolder->addTab(sendCoinsTab,tr("Bitcoin"));
Expand Down

0 comments on commit d121954

Please sign in to comment.