diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 854257d03cf1..b975e8161342 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -353,7 +353,27 @@ RES_CSS = \ qt/res/css/general.css \ qt/res/css/light.css \ qt/res/css/scrollbars.css \ - qt/res/css/trad.css + qt/res/css/traditional.css + +RES_FONTS = \ + qt/res/fonts/Montserrat/Montserrat-Black.otf \ + qt/res/fonts/Montserrat/Montserrat-BlackItalic.otf \ + qt/res/fonts/Montserrat/Montserrat-Bold.otf \ + qt/res/fonts/Montserrat/Montserrat-BoldItalic.otf \ + qt/res/fonts/Montserrat/Montserrat-ExtraBold.otf \ + qt/res/fonts/Montserrat/Montserrat-ExtraBoldItalic.otf \ + qt/res/fonts/Montserrat/Montserrat-ExtraLight.otf \ + qt/res/fonts/Montserrat/Montserrat-ExtraLightItalic.otf \ + qt/res/fonts/Montserrat/Montserrat-Italic.otf \ + qt/res/fonts/Montserrat/Montserrat-Light.otf \ + qt/res/fonts/Montserrat/Montserrat-LightItalic.otf \ + qt/res/fonts/Montserrat/Montserrat-Medium.otf \ + qt/res/fonts/Montserrat/Montserrat-MediumItalic.otf \ + qt/res/fonts/Montserrat/Montserrat-Regular.otf \ + qt/res/fonts/Montserrat/Montserrat-SemiBold.otf \ + qt/res/fonts/Montserrat/Montserrat-SemiBoldItalic.otf \ + qt/res/fonts/Montserrat/Montserrat-Thin.otf \ + qt/res/fonts/Montserrat/Montserrat-ThinItalic.otf RES_MOVIES = $(wildcard $(srcdir)/qt/res/movies/spinner-*.png) @@ -367,7 +387,7 @@ qt_libdashqt_a_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS) qt_libdashqt_a_OBJCXXFLAGS = $(AM_OBJCXXFLAGS) $(QT_PIE_FLAGS) qt_libdashqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \ - $(QT_QRC) $(QT_QRC_LOCALE) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_CSS) $(RES_MOVIES) + $(QT_QRC) $(QT_QRC_LOCALE) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_CSS) $(RES_FONTS) $(RES_MOVIES) nodist_qt_libdashqt_a_SOURCES = $(QT_MOC_CPP) $(QT_MOC) $(PROTOBUF_CC) \ $(PROTOBUF_H) $(QT_QRC_CPP) $(QT_QRC_LOCALE_CPP) @@ -430,7 +450,7 @@ $(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM) $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@ @rm $(@D)/temp_$( $@ diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp index edad38b8e6a9..107721b31229 100644 --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -28,6 +29,10 @@ AskPassphraseDialog::AskPassphraseDialog(Mode _mode, QWidget *parent) : { ui->setupUi(this); + GUIUtil::setFont({ui->capsLabel}, GUIUtil::getFontWeightBold()); + + GUIUtil::disableMacFocusRect(this); + ui->passEdit1->setMinimumSize(ui->passEdit1->sizeHint()); ui->passEdit2->setMinimumSize(ui->passEdit2->sizeHint()); ui->passEdit3->setMinimumSize(ui->passEdit3->sizeHint()); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index ef76c7aa7a6c..1ed1f82ae494 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -55,6 +56,7 @@ #include #include #include +#include #include #include @@ -118,13 +120,11 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle * rpcConsole(0), helpMessageDialog(0), modalOverlay(0), + tabGroup(0), prevBlocks(0), spinnerFrame(0), platformStyle(_platformStyle) { - /* Open CSS when configured */ - this->setStyleSheet(GUIUtil::loadStyleSheet()); - QSettings settings; if (!restoreGeometry(settings.value("MainWindowGeometry").toByteArray())) { // Restore failed (perhaps missing setting), center the window @@ -148,7 +148,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle * setWindowIcon(networkStyle->getTrayAndWindowIcon()); setWindowTitle(windowTitle); - rpcConsole = new RPCConsole(_platformStyle, 0); + rpcConsole = new RPCConsole(_platformStyle, this); helpMessageDialog = new HelpMessageDialog(this, HelpMessageDialog::cmdline); #ifdef ENABLE_WALLET if(enableWallet) @@ -216,6 +216,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle * // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(true); + progressBarLabel->setObjectName("lblStatusBarProgress"); progressBar = new GUIUtil::ProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(true); @@ -279,13 +280,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); @@ -294,9 +297,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); @@ -305,13 +309,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); @@ -320,13 +325,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); @@ -335,13 +341,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); @@ -350,12 +357,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); @@ -364,29 +372,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); @@ -575,32 +586,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. @@ -828,6 +840,7 @@ void BitcoinGUI::optionsClicked() OptionsDialog dlg(this, enableWallet); dlg.setModel(clientModel->getOptionsModel()); + connect(&dlg, &OptionsDialog::themeChanged, [=](){GUIUtil::loadTheme();}); dlg.exec(); } @@ -909,6 +922,11 @@ void BitcoinGUI::openClicked() } } +void BitcoinGUI::highlightTabButton(QAbstractButton *button, bool checked) +{ + GUIUtil::setFont({button}, checked ? GUIUtil::getFontWeightBold() : GUIUtil::getFontWeightNormal()); +} + void BitcoinGUI::gotoOverviewPage() { overviewAction->setChecked(true); @@ -1508,8 +1526,7 @@ void BitcoinGUI::showProgress(const QString &title, int nProgress) { if (nProgress == 0) { - progressDialog = new QProgressDialog(title, "", 0, 100); - progressDialog->setStyleSheet(GUIUtil::loadStyleSheet()); + progressDialog = new QProgressDialog(title, "", 0, 100, this); progressDialog->setWindowModality(Qt::ApplicationModal); progressDialog->setMinimumDuration(0); progressDialog->setCancelButton(0); @@ -1595,7 +1612,7 @@ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl(const PlatformStyle *pl setToolTip(tr("Unit to show amounts in. Click to select another unit.")); QList units = BitcoinUnits::availableUnits(); int max_width = 0; - const QFontMetrics fm(font()); + const QFontMetrics fm(GUIUtil::getFontNormal()); for (const BitcoinUnits::Unit unit : units) { max_width = qMax(max_width, fm.width(BitcoinUnits::name(unit))); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index e927210773ff..4083cf6a654d 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -40,6 +40,7 @@ QT_BEGIN_NAMESPACE class QAction; class QProgressBar; class QProgressDialog; +class QToolButton; QT_END_NAMESPACE /** @@ -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; @@ -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; @@ -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(); diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 606465b3d1e0..810fdc8e024e 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -51,9 +51,17 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *_platformStyle, QWidge { ui->setupUi(this); - /* Open CSS when configured */ - this->setStyleSheet(GUIUtil::loadStyleSheet()); - + GUIUtil::setFont({ui->labelCoinControlQuantityText, + ui->labelCoinControlBytesText, + ui->labelCoinControlAmountText, + ui->labelCoinControlLowOutputText, + ui->labelCoinControlFeeText, + ui->labelCoinControlAfterFeeText, + ui->labelCoinControlChangeText + }, GUIUtil::getFontWeightBold()); + + GUIUtil::disableMacFocusRect(this); + // context menu actions QAction *copyAddressAction = new QAction(tr("Copy address"), this); QAction *copyLabelAction = new QAction(tr("Copy label"), this); @@ -224,9 +232,8 @@ void CoinControlDialog::buttonToggleLockClicked() CoinControlDialog::updateLabels(model, this); } else{ - QMessageBox msgBox; + QMessageBox msgBox(this); msgBox.setObjectName("lockMessageBox"); - msgBox.setStyleSheet(GUIUtil::loadStyleSheet()); msgBox.setText(tr("Please switch to \"List mode\" to use this function.")); msgBox.exec(); } diff --git a/src/qt/dash.cpp b/src/qt/dash.cpp index fee5ad059fa4..c4ad5ea9a674 100644 --- a/src/qt/dash.cpp +++ b/src/qt/dash.cpp @@ -272,6 +272,11 @@ bool BitcoinCore::baseInitialize() { return false; } + if (!GUIUtil::loadFonts()) + { + return false; + } + GUIUtil::loadTheme(); return true; } @@ -395,6 +400,8 @@ void BitcoinApplication::createWindow(const NetworkStyle *networkStyle) { window = new BitcoinGUI(platformStyle, networkStyle, 0); + GUIUtil::loadTheme(window); + pollShutdownTimer = new QTimer(window); connect(pollShutdownTimer, SIGNAL(timeout()), window, SLOT(detectShutdown())); } @@ -691,6 +698,76 @@ int main(int argc, char *argv[]) // Load GUI settings from QSettings app.createOptionsModel(gArgs.GetBoolArg("-resetguisettings", false)); + // Validate/set normal font weight + if (gArgs.IsArgSet("-font-weight-normal")) { + QFont::Weight weight; + if (!GUIUtil::weightFromArg(gArgs.GetArg("-font-weight-normal", GUIUtil::getFontWeightNormal()), weight)) { + QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), + QObject::tr("Error: Specified font-weight-normal invalid. Valid range 0 to 8.")); + return EXIT_FAILURE; + } + GUIUtil::setFontWeightNormal(weight); + } + // Validate/set bold font weight + if (gArgs.IsArgSet("-font-weight-bold")) { + QFont::Weight weight; + if (!GUIUtil::weightFromArg(gArgs.GetArg("-font-weight-bold", GUIUtil::getFontWeightBold()), weight)) { + QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), + QObject::tr("Error: Specified font-weight-bold invalid. Valid range 0 to 8.")); + return EXIT_FAILURE; + } + GUIUtil::setFontWeightBold(weight); + } + // Validate/set font scale + if (gArgs.IsArgSet("-font-scale")) { + const int nScaleMin = -100, nScaleMax = 100; + int nScale = gArgs.GetArg("-font-scale", GUIUtil::getFontScale()); + if (nScale < nScaleMin || nScale > nScaleMax) { + QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), + QObject::tr("Error: Specified font-scale invalid. Valid range %1 to %2.").arg(nScaleMin).arg(nScaleMax)); + return EXIT_FAILURE; + } + GUIUtil::setFontScale(nScale); + } + + if (gArgs.IsArgSet("-custom-css-dir")) { + + fs::path path = fs::path(gArgs.GetArg("-custom-css-dir", "")); + std::vector vecRequiredCSSFiles = GUIUtil::listStyleSheets(); + QString strMissing; + + if (!fs::is_directory(path)) { + QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), + QObject::tr("Error: Invalid custom css directory path: %1.").arg(QString::fromStdString(path.string()))); + return EXIT_FAILURE; + } + + for (auto it = fs::directory_iterator(path); it != fs::directory_iterator(); ++it) { + + if (fs::is_regular_file(*it) && it->path().extension() == ".css") { + std::string test = it->path().filename().string(); + auto css = std::find(vecRequiredCSSFiles.begin(), vecRequiredCSSFiles.end(), + QString::fromStdString(test)); + + if (css != vecRequiredCSSFiles.end()) { + vecRequiredCSSFiles.erase(css); + } else { + strMissing += QString::fromStdString(it->path().filename().string()) + "\n"; + } + } + } + + if (vecRequiredCSSFiles.size()) { + QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), + QObject::tr("Error: %1 CSS file(s) missig in custom css directory.\n\n%2") + .arg(vecRequiredCSSFiles.size()) + .arg(strMissing)); + return EXIT_FAILURE; + } + + GUIUtil::setStyleSheetDirectory(QString::fromStdString(path.string())); + } + // Subscribe to global signals from core uiInterface.InitMessage.connect(InitMessage); diff --git a/src/qt/dash.qrc b/src/qt/dash.qrc index b66c470d61ac..392e0ce6cf8c 100644 --- a/src/qt/dash.qrc +++ b/src/qt/dash.qrc @@ -57,11 +57,29 @@ res/css/general.css res/css/scrollbars.css - - res/css/dark.css res/css/light.css - res/css/trad.css + res/css/traditional.css + + + res/fonts/Montserrat/Montserrat-Black.otf + res/fonts/Montserrat/Montserrat-BlackItalic.otf + res/fonts/Montserrat/Montserrat-Bold.otf + res/fonts/Montserrat/Montserrat-BoldItalic.otf + res/fonts/Montserrat/Montserrat-ExtraBold.otf + res/fonts/Montserrat/Montserrat-ExtraBoldItalic.otf + res/fonts/Montserrat/Montserrat-ExtraLight.otf + res/fonts/Montserrat/Montserrat-ExtraLightItalic.otf + res/fonts/Montserrat/Montserrat-Italic.otf + res/fonts/Montserrat/Montserrat-Light.otf + res/fonts/Montserrat/Montserrat-LightItalic.otf + res/fonts/Montserrat/Montserrat-Medium.otf + res/fonts/Montserrat/Montserrat-MediumItalic.otf + res/fonts/Montserrat/Montserrat-Regular.otf + res/fonts/Montserrat/Montserrat-SemiBold.otf + res/fonts/Montserrat/Montserrat-SemiBoldItalic.otf + res/fonts/Montserrat/Montserrat-Thin.otf + res/fonts/Montserrat/Montserrat-ThinItalic.otf res/images/arrow_down_normal.png diff --git a/src/qt/editaddressdialog.cpp b/src/qt/editaddressdialog.cpp index 2f49a13aadaa..1c1f0f9126c8 100644 --- a/src/qt/editaddressdialog.cpp +++ b/src/qt/editaddressdialog.cpp @@ -21,6 +21,8 @@ EditAddressDialog::EditAddressDialog(Mode _mode, QWidget *parent) : { ui->setupUi(this); + GUIUtil::disableMacFocusRect(this); + GUIUtil::setupAddressWidget(ui->addressEdit, this); switch(mode) diff --git a/src/qt/forms/askpassphrasedialog.ui b/src/qt/forms/askpassphrasedialog.ui index 69803989cd13..67fee3cd3dea 100644 --- a/src/qt/forms/askpassphrasedialog.ui +++ b/src/qt/forms/askpassphrasedialog.ui @@ -101,12 +101,6 @@ - - - 75 - true - - diff --git a/src/qt/forms/coincontroldialog.ui b/src/qt/forms/coincontroldialog.ui index e5cf02c62c41..7d226fd6a226 100644 --- a/src/qt/forms/coincontroldialog.ui +++ b/src/qt/forms/coincontroldialog.ui @@ -38,12 +38,6 @@ - - - 75 - true - - Quantity: @@ -67,12 +61,6 @@ - - - 75 - true - - Bytes: @@ -112,12 +100,6 @@ - - - 75 - true - - Amount: @@ -144,12 +126,6 @@ false - - - 75 - true - - Dust: @@ -192,12 +168,6 @@ - - - 75 - true - - Fee: @@ -237,12 +207,6 @@ - - - 75 - true - - After Fee: @@ -269,12 +233,6 @@ false - - - 75 - true - - Change: diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index ee3f74dbe159..9df65c113916 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -15,26 +15,83 @@ - + + + 0 + + + 0 + + + + + &Information + + + true + + + + + + + &Console + + + true + + + + + + + &Network Traffic + + + true + + + + + + + &Peers + + + true + + + + + + + &Wallet Repair + + + true + + + + + + + + + + 0 + 0 + + 0 - - - &Information - + 12 - - - 75 - true - - General @@ -165,17 +222,11 @@ - - - - 75 - true - - - - Network - - + + + Network + + @@ -248,12 +299,6 @@ - - - 75 - true - - Block chain @@ -307,12 +352,6 @@ - - - 75 - true - - Memory Pool @@ -442,10 +481,7 @@ - - - &Console - + 3 @@ -479,14 +515,14 @@ 24 - - - Decrease font size + + + - + :/icons/fontsmaller:/icons/fontsmaller @@ -518,7 +554,7 @@ - + :/icons/fontbigger:/icons/fontbigger @@ -553,7 +589,7 @@ - + :/icons/console_remove:/icons/console_remove @@ -608,7 +644,7 @@ - + :/icons/prompticon :/icons/prompticon:/icons/prompticon @@ -637,10 +673,7 @@ - - - &Network Traffic - + @@ -890,10 +923,7 @@ - - - &Peers - + @@ -936,11 +966,6 @@ 32 - - - 12 - - IBeamCursor @@ -996,13 +1021,6 @@ 32 - - - 10 - 75 - true - - IBeamCursor @@ -1464,10 +1482,7 @@ - - - &Wallet Repair - + @@ -1572,12 +1587,6 @@ 41 - - - 50 - false - - The buttons below will restart the wallet with command-line options to repair the wallet, fix issues with corrupt blockhain files or missing/obsolete transactions. @@ -1674,13 +1683,6 @@ 16 - - - 10 - 75 - true - - Wallet repair options. @@ -1746,8 +1748,6 @@ - - - + diff --git a/src/qt/forms/modaloverlay.ui b/src/qt/forms/modaloverlay.ui index 7bf5a7a1f853..b39222017986 100644 --- a/src/qt/forms/modaloverlay.ui +++ b/src/qt/forms/modaloverlay.ui @@ -140,12 +140,6 @@ - - - 75 - true - - Attempting to spend Dash that are affected by not-yet-displayed transactions will not be accepted by the network. @@ -203,12 +197,6 @@ - - - 75 - true - - Number of blocks left @@ -223,12 +211,6 @@ - - - 75 - true - - Last block time @@ -249,12 +231,6 @@ - - - 75 - true - - Progress @@ -283,12 +259,6 @@ - - - 75 - true - - Progress increase per hour @@ -303,12 +273,6 @@ - - - 75 - true - - Estimated time left until synced diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 03d446e415cc..c507210394a8 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -18,14 +18,77 @@ - + + + 0 + + + 0 + + + + + &Main + + + true + + + + + + + W&allet + + + true + + + + + + + &Network + + + true + + + + + + + &Window + + + true + + + + + + + &Display + + + true + + + + + + + + + + 0 + 0 + + 0 - - - &Main - + @@ -132,10 +195,7 @@ - - - W&allet - + @@ -300,10 +360,7 @@ - - - &Network - + @@ -618,10 +675,7 @@ - - - &Window - + @@ -668,10 +722,7 @@ - - - &Display - + @@ -908,12 +959,6 @@ https://www.transifex.com/projects/p/dash/ 0 - - - 75 - true - - diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index af5626b88f56..616a6c151813 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -56,12 +56,6 @@ - - - 75 - true - - Balances @@ -102,12 +96,6 @@ - - - 75 - true - - IBeamCursor @@ -127,12 +115,6 @@ - - - 75 - true - - IBeamCursor @@ -152,12 +134,6 @@ - - - 75 - true - - IBeamCursor @@ -210,12 +186,6 @@ - - - 75 - true - - IBeamCursor @@ -255,12 +225,6 @@ - - - 75 - true - - IBeamCursor @@ -280,12 +244,6 @@ - - - 75 - true - - IBeamCursor @@ -322,12 +280,6 @@ - - - 75 - true - - IBeamCursor @@ -347,12 +299,6 @@ - - - 75 - true - - IBeamCursor @@ -408,12 +354,6 @@ - - - 75 - true - - PrivateSend @@ -501,12 +441,6 @@ - - - 75 - true - - 0 DASH @@ -541,37 +475,86 @@ n/a + + true + + + + + (Last Message) + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + - - - (Last Message) - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true + + + 0 - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Start/Stop Mixing + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - - 0 - 0 - + + + Qt::Vertical - - Start/Stop Mixing + + + 20 + 40 + - + @@ -608,12 +591,6 @@ - - - 75 - true - - Recent transactions diff --git a/src/qt/forms/qrdialog.ui b/src/qt/forms/qrdialog.ui index 8366b7c857a6..dae494ccc825 100644 --- a/src/qt/forms/qrdialog.ui +++ b/src/qt/forms/qrdialog.ui @@ -13,12 +13,6 @@ - - - 75 - true - - QR-Code Title diff --git a/src/qt/forms/receivecoinsdialog.ui b/src/qt/forms/receivecoinsdialog.ui index 5ee764446afc..fa6c1f182250 100644 --- a/src/qt/forms/receivecoinsdialog.ui +++ b/src/qt/forms/receivecoinsdialog.ui @@ -201,12 +201,6 @@ - - - 75 - true - - Requested payments history diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index 4f00c759ad94..432f3018f513 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -77,15 +77,6 @@ 0 - - - 75 - true - - - - font-weight:bold; - Coin Control Features @@ -126,15 +117,6 @@ - - - 75 - true - - - - font-weight:bold; - Insufficient funds! @@ -218,12 +200,6 @@ - - - 75 - true - - Quantity: @@ -253,12 +229,6 @@ - - - 75 - true - - Bytes: @@ -301,12 +271,6 @@ - - - 75 - true - - Amount: @@ -333,12 +297,6 @@ - - - 75 - true - - Dust: @@ -381,12 +339,6 @@ - - - 75 - true - - Fee: @@ -432,12 +384,6 @@ - - - 75 - true - - After Fee: @@ -464,12 +410,6 @@ - - - 75 - true - - Change: @@ -714,15 +654,6 @@ 0 - - - 75 - true - - - - font-weight:bold; - Transaction Fee: @@ -762,12 +693,6 @@ Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain. - - - 75 - true - - Note: Not enough data for fee estimation, using the fallback fee instead. @@ -853,8 +778,11 @@ 6 + + 3 + - + @@ -930,6 +858,12 @@ + + 20 + + + 3 + @@ -960,6 +894,9 @@ + + 30 + @@ -991,7 +928,10 @@ 6 - 2 + 0 + + + 3 @@ -1051,19 +991,6 @@ - - - - Qt::Vertical - - - - 1 - 1 - - - - @@ -1211,7 +1138,7 @@ 3 - + Balance: @@ -1220,7 +1147,7 @@ - + 0 0 diff --git a/src/qt/forms/signverifymessagedialog.ui b/src/qt/forms/signverifymessagedialog.ui index 90446e553dca..278c9c7733c0 100644 --- a/src/qt/forms/signverifymessagedialog.ui +++ b/src/qt/forms/signverifymessagedialog.ui @@ -18,14 +18,47 @@ - + + + 0 + + + 0 + + + + + &Sign Message + + + true + + + + + + + &Verify Message + + + true + + + + + + + + + + 0 + 0 + + 0 - - - &Sign Message - + @@ -110,11 +143,6 @@ - - - true - - true @@ -178,12 +206,6 @@ - - - 75 - true - - @@ -209,10 +231,7 @@ - - - &Verify Message - + @@ -309,12 +328,6 @@ - - - 75 - true - - diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 9f69e9dd9835..5a5790db71ee 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -16,6 +16,7 @@ #include #include