Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 64 additions & 43 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

#include <QAction>
#include <QApplication>
#include <QButtonGroup>
#include <QDateTime>
#include <QDesktopWidget>
#include <QDragEnterEvent>
Expand All @@ -55,6 +56,7 @@
#include <QStyle>
#include <QTimer>
#include <QToolBar>
#include <QToolButton>
#include <QUrlQuery>
#include <QVBoxLayout>

Expand Down Expand Up @@ -118,6 +120,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
rpcConsole(0),
helpMessageDialog(0),
modalOverlay(0),
tabGroup(0),
prevBlocks(0),
spinnerFrame(0),
platformStyle(_platformStyle)
Expand Down Expand Up @@ -279,13 +282,15 @@ BitcoinGUI::~BitcoinGUI()
#endif

delete rpcConsole;
delete tabGroup;
}

void BitcoinGUI::createActions()
{
QActionGroup *tabGroup = new QActionGroup(this);
tabGroup = new QButtonGroup(this);

overviewAction = new QAction(tr("&Overview"), this);
overviewAction = new QToolButton(this);
overviewAction->setText(tr("&Overview"));
overviewAction->setStatusTip(tr("Show general overview of wallet"));
overviewAction->setToolTip(overviewAction->statusTip());
overviewAction->setCheckable(true);
Expand All @@ -294,9 +299,10 @@ void BitcoinGUI::createActions()
#else
overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1));
#endif
tabGroup->addAction(overviewAction);
tabGroup->addButton(overviewAction);

sendCoinsAction = new QAction(tr("&Send"), this);
sendCoinsAction = new QToolButton(this);
sendCoinsAction->setText(tr("&Send"));
sendCoinsAction->setStatusTip(tr("Send coins to a Dash address"));
sendCoinsAction->setToolTip(sendCoinsAction->statusTip());
sendCoinsAction->setCheckable(true);
Expand All @@ -305,13 +311,14 @@ void BitcoinGUI::createActions()
#else
sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
#endif
tabGroup->addAction(sendCoinsAction);
tabGroup->addButton(sendCoinsAction);

sendCoinsMenuAction = new QAction(QIcon(":/icons/send"), sendCoinsAction->text(), this);
sendCoinsMenuAction->setStatusTip(sendCoinsAction->statusTip());
sendCoinsMenuAction->setToolTip(sendCoinsMenuAction->statusTip());

privateSendCoinsAction = new QAction(tr("&PrivateSend"), this);
privateSendCoinsAction = new QToolButton(this);
privateSendCoinsAction->setText(tr("&PrivateSend"));
privateSendCoinsAction->setStatusTip(tr("PrivateSend coins to a Dash address"));
privateSendCoinsAction->setToolTip(privateSendCoinsAction->statusTip());
privateSendCoinsAction->setCheckable(true);
Expand All @@ -320,13 +327,14 @@ void BitcoinGUI::createActions()
#else
privateSendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
#endif
tabGroup->addAction(privateSendCoinsAction);
tabGroup->addButton(privateSendCoinsAction);

privateSendCoinsMenuAction = new QAction(QIcon(":/icons/send"), privateSendCoinsAction->text(), this);
privateSendCoinsMenuAction->setStatusTip(privateSendCoinsAction->statusTip());
privateSendCoinsMenuAction->setToolTip(privateSendCoinsMenuAction->statusTip());

receiveCoinsAction = new QAction(tr("&Receive"), this);
receiveCoinsAction = new QToolButton(this);
receiveCoinsAction->setText(tr("&Receive"));
receiveCoinsAction->setStatusTip(tr("Request payments (generates QR codes and dash: URIs)"));
receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip());
receiveCoinsAction->setCheckable(true);
Expand All @@ -335,13 +343,14 @@ void BitcoinGUI::createActions()
#else
receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
#endif
tabGroup->addAction(receiveCoinsAction);
tabGroup->addButton(receiveCoinsAction);

receiveCoinsMenuAction = new QAction(QIcon(":/icons/receiving_addresses"), receiveCoinsAction->text(), this);
receiveCoinsMenuAction->setStatusTip(receiveCoinsAction->statusTip());
receiveCoinsMenuAction->setToolTip(receiveCoinsMenuAction->statusTip());

historyAction = new QAction(tr("&Transactions"), this);
historyAction = new QToolButton(this);
historyAction->setText(tr("&Transactions"));
historyAction->setStatusTip(tr("Browse transaction history"));
historyAction->setToolTip(historyAction->statusTip());
historyAction->setCheckable(true);
Expand All @@ -350,12 +359,13 @@ void BitcoinGUI::createActions()
#else
historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
#endif
tabGroup->addAction(historyAction);
tabGroup->addButton(historyAction);

#ifdef ENABLE_WALLET
QSettings settings;
if (settings.value("fShowMasternodesTab").toBool()) {
masternodeAction = new QAction(tr("&Masternodes"), this);
masternodeAction = new QToolButton(this);
masternodeAction->setText(tr("&Masternodes"));
masternodeAction->setStatusTip(tr("Browse masternodes"));
masternodeAction->setToolTip(masternodeAction->statusTip());
masternodeAction->setCheckable(true);
Expand All @@ -364,29 +374,32 @@ void BitcoinGUI::createActions()
#else
masternodeAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));
#endif
tabGroup->addAction(masternodeAction);
connect(masternodeAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(masternodeAction, SIGNAL(triggered()), this, SLOT(gotoMasternodePage()));
tabGroup->addButton(masternodeAction);
connect(masternodeAction, SIGNAL(clicked()), this, SLOT(showNormalIfMinimized()));
connect(masternodeAction, SIGNAL(clicked()), this, SLOT(gotoMasternodePage()));
}

// These showNormalIfMinimized are needed because Send Coins and Receive Coins
// can be triggered from the tray menu, and need to show the GUI to be useful.
connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage()));
connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));
connect(overviewAction, SIGNAL(clicked()), this, SLOT(showNormalIfMinimized()));
connect(overviewAction, SIGNAL(clicked()), this, SLOT(gotoOverviewPage()));
connect(sendCoinsAction, SIGNAL(clicked()), this, SLOT(showNormalIfMinimized()));
connect(sendCoinsAction, SIGNAL(clicked()), this, SLOT(gotoSendCoinsPage()));
connect(sendCoinsMenuAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(sendCoinsMenuAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));
connect(privateSendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(privateSendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoPrivateSendCoinsPage()));
connect(privateSendCoinsAction, SIGNAL(clicked()), this, SLOT(showNormalIfMinimized()));
connect(privateSendCoinsAction, SIGNAL(clicked()), this, SLOT(gotoPrivateSendCoinsPage()));
connect(privateSendCoinsMenuAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(privateSendCoinsMenuAction, SIGNAL(triggered()), this, SLOT(gotoPrivateSendCoinsPage()));
connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
connect(receiveCoinsAction, SIGNAL(clicked()), this, SLOT(showNormalIfMinimized()));
connect(receiveCoinsAction, SIGNAL(clicked()), this, SLOT(gotoReceiveCoinsPage()));
connect(receiveCoinsMenuAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(receiveCoinsMenuAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
connect(historyAction, SIGNAL(clicked()), this, SLOT(showNormalIfMinimized()));
connect(historyAction, SIGNAL(clicked()), this, SLOT(gotoHistoryPage()));

// Give the selected tab button a bolder font.
connect(tabGroup, SIGNAL(buttonToggled(QAbstractButton *, bool)), this, SLOT(highlightTabButton(QAbstractButton *, bool)));
#endif // ENABLE_WALLET

quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this);
Expand Down Expand Up @@ -575,32 +588,33 @@ void BitcoinGUI::createToolBars()
{
QToolBar *toolbar = new QToolBar(tr("Tabs toolbar"));
toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(privateSendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
toolbar->setToolButtonStyle(Qt::ToolButtonTextOnly);

overviewAction->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
sendCoinsAction->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
privateSendCoinsAction->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
receiveCoinsAction->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
historyAction->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);

toolbar->addWidget(overviewAction);
toolbar->addWidget(sendCoinsAction);
toolbar->addWidget(privateSendCoinsAction);
toolbar->addWidget(receiveCoinsAction);
toolbar->addWidget(historyAction);

QSettings settings;
if (settings.value("fShowMasternodesTab").toBool() && masternodeAction) {
toolbar->addAction(masternodeAction);
masternodeAction->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
toolbar->addWidget(masternodeAction);
}
toolbar->setMovable(false); // remove unused icon in upper left corner
overviewAction->setChecked(true);

// Add Dash logo on the right side
QWidget* spacer = new QWidget();
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
toolbar->addWidget(spacer);

QLabel *logoLabel = new QLabel();
QString logoImage = ":/images/dash_logo_toolbar";
if (!GUIUtil::dashThemeActive()) {
logoImage = ":/images/dash_logo_toolbar_blue";
}
logoLabel->setObjectName("lblToolbarLogo");
logoLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);

QPixmap logoPixmap(logoImage);
logoLabel->setPixmap(logoPixmap);
toolbar->addWidget(logoLabel);

/** Create additional container for toolbar and walletFrame and make it the central widget.
Expand Down Expand Up @@ -909,6 +923,13 @@ void BitcoinGUI::openClicked()
}
}

void BitcoinGUI::highlightTabButton(QAbstractButton *button, bool checked)
{
QFont font = button->font();
font.setBold(checked);
button->setFont(font);
}

void BitcoinGUI::gotoOverviewPage()
{
overviewAction->setChecked(true);
Expand Down
17 changes: 11 additions & 6 deletions src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ QT_BEGIN_NAMESPACE
class QAction;
class QProgressBar;
class QProgressDialog;
class QToolButton;
QT_END_NAMESPACE

/**
Expand Down Expand Up @@ -95,20 +96,20 @@ class BitcoinGUI : public QMainWindow
QProgressDialog *progressDialog;

QMenuBar *appMenuBar;
QAction *overviewAction;
QAction *historyAction;
QAction *masternodeAction;
QToolButton *overviewAction;
QToolButton *historyAction;
QToolButton *masternodeAction;
QAction *quitAction;
QAction *sendCoinsAction;
QToolButton *sendCoinsAction;
QAction *sendCoinsMenuAction;
QAction *privateSendCoinsAction;
QToolButton *privateSendCoinsAction;
QAction *privateSendCoinsMenuAction;
QAction *usedSendingAddressesAction;
QAction *usedReceivingAddressesAction;
QAction *signMessageAction;
QAction *verifyMessageAction;
QAction *aboutAction;
QAction *receiveCoinsAction;
QToolButton *receiveCoinsAction;
QAction *receiveCoinsMenuAction;
QAction *optionsAction;
QAction *toggleHideAction;
Expand Down Expand Up @@ -136,6 +137,7 @@ class BitcoinGUI : public QMainWindow
RPCConsole *rpcConsole;
HelpMessageDialog *helpMessageDialog;
ModalOverlay *modalOverlay;
QButtonGroup *tabGroup;

#ifdef Q_OS_MAC
CAppNapInhibitor* m_app_nap_inhibitor = nullptr;
Expand Down Expand Up @@ -251,6 +253,9 @@ private Q_SLOTS:

/** Show open dialog */
void openClicked();

/** Highlight checked tab button */
void highlightTabButton(QAbstractButton *button, bool checked);
#endif // ENABLE_WALLET
/** Show configuration dialog */
void optionsClicked();
Expand Down
5 changes: 4 additions & 1 deletion src/qt/res/css/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ QTextEdit {
QToolBar / QToolButton
******************************************************/

/***** No dark.css specific coloring here yet *****/
QToolBar > QToolButton:checked {
background-color: #444;
color: #ccc;
}

/******************************************************
QTreeWidget
Expand Down
38 changes: 22 additions & 16 deletions src/qt/res/css/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -626,35 +626,41 @@ QToolBar / QToolButton

QToolBar {
background-color: #008de4;
border: 0;
border: none;
width: 100%;
padding: 0;
margin: 0;
spacing: 0;
min-height: 50px;
max-height: 50px;
}

QToolBar > QToolButton {
background-color: #008de4;
border: 0;
font-size: 14px;
min-width: 70px;
min-height: 48%;
max-height: 48%;
padding: 0 10px;
margin: 0;
color: #f5f5f5;
background-color: transparent;
border: none;
min-height: 50px;
max-height: 50px;
font-size: 16px;
letter-spacing: 3px;
color: #ffffff;
width: 100%;
padding: 1px;
text-align: center;
}

QToolBar > QToolButton:checked {
border: 0;
font-weight: bold;
QToolBar > QToolButton:hover:!checked {
background-color: #005e98;
color: #DCDCDC;
}

QToolBar > QToolButton:disabled {
color: #444;
}

QToolBar > QLabel {
border: 0;
margin: 10px 0 0 0;
QToolBar QLabel#lblToolbarLogo {
padding: 12px;
image: url(':/images/dash_logo_toolbar');
height: 2.5em;
}

/******************************************************
Expand Down
5 changes: 4 additions & 1 deletion src/qt/res/css/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ QTextEdit {
QToolBar / QToolButton
******************************************************/

/***** No light.css specific coloring here yet *****/
QToolBar > QToolButton:checked {
background-color: #f6f6f6;
color: #333333;
}

/******************************************************
QTreeWidget
Expand Down
10 changes: 10 additions & 0 deletions src/qt/res/css/trad.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Loaded in GUIUtil::loadStyleSheet() in guitil.cpp.
</colors>
*/

/******************************************************
QToolBar / QToolButton
******************************************************/

QToolBar QLabel#lblToolbarLogo {
padding: 12px;
image: url(':/images/dash_logo_toolbar_blue');
height: 2.5em;
}

/******************************************************
ModalOverlay
******************************************************/
Expand Down
Binary file modified src/qt/res/images/dash_logo_toolbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/qt/res/images/dash_logo_toolbar_blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.