Skip to content

Commit

Permalink
[gui] add three options theme
Browse files Browse the repository at this point in the history
  • Loading branch information
hardwarewise committed Feb 1, 2021
1 parent c4749e5 commit 4f0b919
Show file tree
Hide file tree
Showing 45 changed files with 1,754 additions and 961 deletions.
20 changes: 15 additions & 5 deletions src/qt/addressbookpage.cpp
Expand Up @@ -15,6 +15,7 @@
#include <qt/editaddressdialog.h>
#include <qt/guiutil.h>
#include <qt/platformstyle.h>
#include <qt/styleSheet.h>

#include <QIcon>
#include <QMenu>
Expand Down Expand Up @@ -65,18 +66,27 @@ AddressBookPage::AddressBookPage(const PlatformStyle *platformStyle, Mode _mode,
{
ui->setupUi(this);

if (!platformStyle->getImagesOnButtons()) {
SetObjectStyleSheet(ui->tableView, StyleSheetNames::TableViewLight);
setStyleSheet("");

if (!platformStyle->getImagesOnButtons()) {
ui->newAddress->setIcon(QIcon());
ui->copyAddress->setIcon(QIcon());
ui->deleteAddress->setIcon(QIcon());
ui->exportButton->setIcon(QIcon());
} else {
ui->newAddress->setIcon(platformStyle->SingleColorIcon(":/icons/add1"));
ui->copyAddress->setIcon(platformStyle->SingleColorIcon(":/icons/editcopy"));
ui->deleteAddress->setIcon(platformStyle->SingleColorIcon(":/icons/remove1"));
ui->exportButton->setIcon(platformStyle->SingleColorIcon(":/icons/export"));
ui->newAddress->setIcon(platformStyle->MultiStatesIcon(":/icons/add", PlatformStyle::PushButtonLight));
ui->copyAddress->setIcon(platformStyle->MultiStatesIcon(":/icons/editcopy", PlatformStyle::PushButtonLight));
ui->deleteAddress->setIcon(platformStyle->MultiStatesIcon(":/icons/remove", PlatformStyle::PushButtonLight));
ui->exportButton->setIcon(platformStyle->MultiStatesIcon(":/icons/export", PlatformStyle::PushButton));
}

SetObjectStyleSheet(ui->newAddress, StyleSheetNames::ButtonLight);
SetObjectStyleSheet(ui->copyAddress, StyleSheetNames::ButtonLight);
SetObjectStyleSheet(ui->deleteAddress, StyleSheetNames::ButtonLight);
SetObjectStyleSheet(ui->exportButton, StyleSheetNames::ButtonGray);
SetObjectStyleSheet(ui->closeButton, StyleSheetNames::ButtonGray);

switch(mode)
{
case ForSelection:
Expand Down
4 changes: 4 additions & 0 deletions src/qt/askpassphrasedialog.cpp
Expand Up @@ -13,6 +13,7 @@
#include <qt/walletmodel.h>

#include <support/allocators/secure.h>
#include <qt/styleSheet.h>

#include <QKeyEvent>
#include <QMessageBox>
Expand All @@ -27,6 +28,9 @@ AskPassphraseDialog::AskPassphraseDialog(Mode _mode, QWidget *parent) :
{
ui->setupUi(this);

SetObjectStyleSheet(ui->buttonBox->button(QDialogButtonBox::Cancel), StyleSheetNames::ButtonLight);
SetObjectStyleSheet(ui->buttonBox->button(QDialogButtonBox::Ok), StyleSheetNames::ButtonGray);

ui->passEdit1->setMinimumSize(ui->passEdit1->sizeHint());
ui->passEdit2->setMinimumSize(ui->passEdit2->sizeHint());
ui->passEdit3->setMinimumSize(ui->passEdit3->sizeHint());
Expand Down
9 changes: 5 additions & 4 deletions src/qt/coincontroldialog.cpp
Expand Up @@ -21,6 +21,7 @@
#include <validation.h> // For mempool
#include <wallet/fees.h>
#include <wallet/wallet.h>
#include <qt/styleSheet.h>
/*SIN*/
#include <instantx.h>

Expand Down Expand Up @@ -54,7 +55,10 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *_platformStyle, QWidge
platformStyle(_platformStyle)
{
ui->setupUi(this);


// Set stylesheet
SetObjectStyleSheet(ui->pushButtonSelectAll, StyleSheetNames::ButtonDark);
SetObjectStyleSheet(ui->treeWidget, StyleSheetNames::TreeView);

// context menu actions
QAction *copyAddressAction = new QAction(tr("Copy address"), this);
Expand Down Expand Up @@ -122,9 +126,6 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *_platformStyle, QWidge
// ok button
connect(ui->buttonBox, SIGNAL(clicked( QAbstractButton*)), this, SLOT(buttonBoxClicked(QAbstractButton*)));

// close button
connect(ui->btnEsc, &QPushButton::clicked, this, &CoinControlDialog::close);

// (un)select all
connect(ui->pushButtonSelectAll, SIGNAL(clicked()), this, SLOT(buttonSelectAllClicked()));

Expand Down
5 changes: 5 additions & 0 deletions src/qt/editaddressdialog.cpp
Expand Up @@ -7,9 +7,11 @@

#include <qt/addresstablemodel.h>
#include <qt/guiutil.h>
#include <qt/styleSheet.h>

#include <QDataWidgetMapper>
#include <QMessageBox>
#include <QPushButton>


EditAddressDialog::EditAddressDialog(Mode _mode, QWidget *parent) :
Expand All @@ -21,6 +23,9 @@ EditAddressDialog::EditAddressDialog(Mode _mode, QWidget *parent) :
{
ui->setupUi(this);

SetObjectStyleSheet(ui->buttonBox->button(QDialogButtonBox::Cancel), StyleSheetNames::ButtonLight);
SetObjectStyleSheet(ui->buttonBox->button(QDialogButtonBox::Ok), StyleSheetNames::ButtonGray);

GUIUtil::setupAddressWidget(ui->addressEdit, this);

switch(mode)
Expand Down
9 changes: 7 additions & 2 deletions src/qt/guiconstants.h
Expand Up @@ -22,16 +22,17 @@ static const bool DEFAULT_SPLASHSCREEN = true;
/* Transaction list -- unconfirmed transaction */
#define COLOR_UNCONFIRMED QColor(128, 128, 128)
/* Transaction list -- negative amount */
#define COLOR_NEGATIVE QColor(188, 143, 58)
#define COLOR_NEGATIVE QColor(255, 255, 255)
/* Transaction list -- bare address (without label) */
#define COLOR_BAREADDRESS QColor(0, 0, 0)
#define COLOR_BAREADDRESS QColor(140, 140, 140)
/* Transaction list -- TX status decoration - open until date */
#define COLOR_TX_STATUS_OPENUNTILDATE QColor(64, 64, 255)
/* Transaction list -- TX status decoration - danger, tx needs attention */
#define COLOR_TX_STATUS_DANGER QColor(200, 100, 100)
/* Transaction list -- TX status decoration - default color */
#define COLOR_BLACK QColor(0, 0, 0)


/* Tooltips longer than this (in characters) are converted into rich text,
so that they can be word-wrapped.
*/
Expand All @@ -52,4 +53,8 @@ static const int MAX_URI_LENGTH = 255;
#define QAPP_APP_NAME_TESTNET "SIN-Qt-testnet"
#define QAPP_APP_NAME_REGTEST "SIN-Qt-regtest"

/* Mainnet SINOVATE explorer uri */
#define SINOVATE_EXPLORER_MAINNET "<a style= color:#2d9ad0; href='https://explorer.sinovate.io/tx/"
#define SINOVATE_EXPLORER_TESTNET "<a style= color:#2d9ad0; href='https://testnet.sinovate.io/tx/"

#endif // BITCOIN_QT_GUICONSTANTS_H
21 changes: 6 additions & 15 deletions src/qt/guiutil.cpp
Expand Up @@ -410,6 +410,12 @@ void openDebugLogfile()
QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathDebug)));
}

void openDataFolder()
{

QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(GetDataDir())));
}

bool openSinConf()
{
boost::filesystem::path pathConfig = GetConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME));
Expand All @@ -426,21 +432,6 @@ bool openSinConf()
return QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig)));
}

//start Resources web links

void hyperlinks3_slot1(){QString link1 = "https://sinovate.io/whitepaper/"; QDesktopServices::openUrl(QUrl(link1, QUrl::TolerantMode));}
void hyperlinks3_slot2(){QString link1 = "https://sinovate.io/roadmap/"; QDesktopServices::openUrl(QUrl(link1, QUrl::TolerantMode));}
void hyperlinks3_slot3(){QString link1 = "https://docs.sinovate.io/"; QDesktopServices::openUrl(QUrl(link1, QUrl::TolerantMode));}
void hyperlinks3_slot4(){QString link1 = "https://github.com/SINOVATEblockchain/SIN-core/releases/latest/download/sin.conf"; QDesktopServices::openUrl(QUrl(link1, QUrl::TolerantMode));}
void hyperlinks3_slot5(){QString link1 = "https://github.com/SINOVATEblockchain/SIN-core/releases"; QDesktopServices::openUrl(QUrl(link1, QUrl::TolerantMode));}
void hyperlinks3_slot6(){QString link1 = "https://sinovate.io/links/explorer"; QDesktopServices::openUrl(QUrl(link1, QUrl::TolerantMode));}
void hyperlinks3_slot7(){QString link1 = "https://github.com/SINOVATEblockchain/SINWebTool/releases"; QDesktopServices::openUrl(QUrl(link1, QUrl::TolerantMode));}
void hyperlinks3_slot8(){QString link1 = "https://docs.sinovate.io/#/infinity_node_setup_guide"; QDesktopServices::openUrl(QUrl(link1, QUrl::TolerantMode));}
void hyperlinks3_slot9(){QString link1 = "https://coinmarketcap.com/currencies/sinovate/markets/"; QDesktopServices::openUrl(QUrl(link1, QUrl::TolerantMode));}
void hyperlinks3_slot10(){QString link1 = "https://sinovate.io/international-channels/"; QDesktopServices::openUrl(QUrl(link1, QUrl::TolerantMode));}
void hyperlinks3_slot11(){QString link1 = "https://github.com/SINOVATEblockchain/SIN-core/releases/latest/download/bootstrap.zip"; QDesktopServices::openUrl(QUrl(link1, QUrl::TolerantMode));}
//end exchanges and web links

// Dash
void openMNConfigfile()
{
Expand Down
20 changes: 3 additions & 17 deletions src/qt/guiutil.h
Expand Up @@ -121,6 +121,9 @@ namespace GUIUtil
// Open debug.log
void openDebugLogfile();

// Open Data Folder
void openDataFolder();

// Open the config file
bool openSinConf();

Expand All @@ -129,23 +132,6 @@ namespace GUIUtil
void openMNConfigfile();
//

// start Resources Web links
// Function for Hyperlinks


void hyperlinks3_slot1();
void hyperlinks3_slot2();
void hyperlinks3_slot3();
void hyperlinks3_slot4();
void hyperlinks3_slot5();
void hyperlinks3_slot6();
void hyperlinks3_slot7();
void hyperlinks3_slot8();
void hyperlinks3_slot9();
void hyperlinks3_slot10();
void hyperlinks3_slot11();
// end Resources Web links

/** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text
representation if needed. This assures that Qt can word-wrap long tooltip messages.
Tooltips longer than the provided size threshold (in characters) are wrapped.
Expand Down
8 changes: 8 additions & 0 deletions src/qt/modaloverlay.cpp
Expand Up @@ -8,6 +8,8 @@
#include <qt/guiutil.h>

#include <chainparams.h>
#include <qt/platformstyle.h>
#include <qt/styleSheet.h>

#include <QResizeEvent>
#include <QPropertyAnimation>
Expand All @@ -22,6 +24,12 @@ userClosed(false),
foreverHidden(false)
{
ui->setupUi(this);

// Set stylesheet
SetObjectStyleSheet(ui->warningIcon, StyleSheetNames::ButtonTransparent);
QColor warningIconColor = GetStringStyleValue("modaloverlay/warning-icon-color", "#000000");

ui->warningIcon->setIcon(PlatformStyle::SingleColorIcon(":/icons/warning", "#009ee5"));
connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(closeClicked()));
if (parent) {
parent->installEventFilter(this);
Expand Down
96 changes: 96 additions & 0 deletions src/qt/navigationbar.h
@@ -0,0 +1,96 @@
#ifndef NAVIGATIONBAR_H
#define NAVIGATIONBAR_H

#include <QWidget>
#include <QAction>
#include <QList>
#include <QMap>
#include <QSize>

/**
* @brief The NavigationBar class Custom control for navigation bar
*/
class NavigationBar : public QWidget
{
Q_OBJECT
public:
/**
* @brief NavigationBar Constructor
* @param parent Parent widget
*/
explicit NavigationBar(QWidget *parent = 0);

/**
* @brief addAction Add action to the navigation bar
* @param action Action to add
*/
void addAction(QAction *action);

/**
* @brief addGroup Add group of actions
* @param list List of actions
* @param icon Icon for the group of actions
* @param text Text for the group of actions
* @return New action associated with the group
*/
QAction *addGroup(QList<QAction*> list, const QIcon &icon, const QString &text);

/**
* @brief addGroup Add group of actions
* @param list List of actions
* @param text Text for the group of actions
* @return New action associated with the group
*/
QAction *addGroup(QList<QAction*> list, const QString &text);

/**
* @brief mapGroup Map the action with group
* @param action Action result of group creation
* @param list List of group actions
*/
void mapGroup(QAction* action, QList<QAction*> list);

/**
* @brief buildUi Construct the layout of the composite GUI control
*/
void buildUi();

Q_SIGNALS:
/**
* @brief resized Signal that the size is changed
*/
/*void resized(const QSize&);*/

public Q_SLOTS:
/**
* @brief onSubBarClick Activate the sub-navigation bar
*/
void onSubBarClick(bool);

/**
* @brief setToolButtonStyle Set the style for the tool buttons
* @param toolButtonStyle Tool button style
*/
void setToolButtonStyle(Qt::ToolButtonStyle toolButtonStyle);

protected:
void resizeEvent(QResizeEvent * evt);

private:

/**
* @brief setSubBar Set the component be sub-navigation bar
* @param subBar Is the component sub-navigation bar
*/
void setSubBar(bool subBar);

QList<QAction*> m_actions;
QMap<QAction*, QList<QAction*>> m_groups;
Qt::ToolButtonStyle m_toolStyle;
bool m_subBar;
bool m_built;
int m_logoSpace;
};

#endif // NAVIGATIONBAR_H

7 changes: 7 additions & 0 deletions src/qt/openuridialog.cpp
Expand Up @@ -7,14 +7,21 @@

#include <qt/guiutil.h>
#include <qt/walletmodel.h>
#include <qt/styleSheet.h>

#include <QUrl>
#include <QPushButton>


OpenURIDialog::OpenURIDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::OpenURIDialog)
{
ui->setupUi(this);

SetObjectStyleSheet(ui->buttonBox->button(QDialogButtonBox::Cancel), StyleSheetNames::ButtonLight);
SetObjectStyleSheet(ui->buttonBox->button(QDialogButtonBox::Ok), StyleSheetNames::ButtonGray);

ui->uriEdit->setPlaceholderText("sin:");
}

Expand Down

0 comments on commit 4f0b919

Please sign in to comment.