Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI improvements #32

Merged
merged 14 commits into from
Oct 1, 2019
Next Next commit
UI improvements
**bitcoingui.cpp changes***
added row --> QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
High DPI Displays can cause some issues fors scaling. AA_DisableHighDpiScaling attribute turns off all scaling

Selection of logout or settings from menu is now working

SingleColorIcon chnaged to TextColorIcon for some of rows. See also platformstyle.cpp changes.


**Platformstyle.cpp changes***
few small color changes to QIcon ColorizeIcon.
Now colour changes to be same than other UI colours instead of using black color (or default color from QPalette::WindowText)


***Overviewpage.cpp changes***
font.setPixelSize used (old font.setPointSize). PointSize is not scaling correctly.
OverviewPage::OverviewPage --> SetStyleeSheet rows removed. Using settings from overviewpage.ui file.

***Overviewpage.ui changes***
Only font pixel size used
Some changes to sizepolicies. Expanding changed to Preferred for some objects.

***Coincontroldialog.ui changes***
Some changes to colours.

***Default.css changes***
QWidget added --> Needed for status bar so that it is more readable 
default.css is loaded by usin loadStyleSheet and it is used at least guiutil.cpp and bitcoingui.cpp files
  • Loading branch information
rausi authored Sep 2, 2019
commit 03af49be5fe2f5c4ad2d21c3769298586e240b1b
44 changes: 22 additions & 22 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
QApplication::setWindowIcon(networkStyle->getTrayAndWindowIcon());
setWindowIcon(networkStyle->getTrayAndWindowIcon());
#else
/*High DPI Displays can cause some issues fors scaling. AA_DisableHighDpiScaling attribute turns off all scaling.
This attribute should be removed if scaleing is needed. note:ui settings must support scaling correctly*/
QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
MacDockIconHandler::instance()->setIcon(networkStyle->getAppIcon());
#endif
setWindowTitle(windowTitle);
Expand Down Expand Up @@ -271,12 +274,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
walletFrame->setStakingStatus(tr("Staking is turned off."),false);
}

// Progress bar and label for blocks download
placeholderLabel = new QLabel();
placeholderLabel->setPixmap(platformStyle->SingleColorIcon(":/icons/spacer").pixmap(145, 40));
placeholderLabel->setAlignment(Qt::AlignCenter);


// Progress bar and label for blocks download
progressBarLabel = new QLabel();
progressBarLabel->setVisible(false);
progressBar = new GUIUtil::ProgressBar();
Expand All @@ -291,13 +289,12 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
//QString curStyle = QApplication::style()->metaObject()->className();
//if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
//{
progressBar->setStyleSheet("QProgressBar { background-color: #1b2234; border: transparent; border-radius: 10px; padding: 1px; text-align: center; } QProgressBar::chunk { background: #39df7b; border-radius: 4px; margin: 4px; }");
progressBar->setStyleSheet("QProgressBar { background-color: #1b2234; border: transparent; border-radius: 10px; padding: 1px; text-align: center; } QProgressBar::chunk { background: #39df7b; border-radius: 7px; margin: 0px; }");
//}


statusBar()->addWidget(progressBarIcon);
statusBar()->addWidget(progressBarLabel);
statusBar()->addWidget(placeholderLabel);
statusBar()->addWidget(progressBar);
statusBar()->addPermanentWidget(frameBlocks);

Expand Down Expand Up @@ -334,7 +331,7 @@ void BitcoinGUI::createActions()

QActionGroup *tabGroup = new QActionGroup(this);

emptyAction = new QAction(platformStyle->SingleColorIcon(":/icons/spacerBlock"), tr(""), this);
emptyAction = new QAction(platformStyle->SingleColorIcon(":/icons/none"), tr(""), this);
emptyAction->setCheckable(false);
emptyAction->setEnabled(false);
tabGroup->addAction(emptyAction);
Expand Down Expand Up @@ -368,7 +365,7 @@ void BitcoinGUI::createActions()
receiveCoinsMenuAction->setStatusTip(receiveCoinsAction->statusTip());
receiveCoinsMenuAction->setToolTip(receiveCoinsMenuAction->statusTip());

toggleStakingAction = new QAction(platformStyle->SingleColorIcon(":/icons/staking_off_menu"), tr("Toggle &Staking"), this);
toggleStakingAction = new QAction(platformStyle->TextColorIcon(":/icons/staking_off_menu"), tr("Toggle &Staking"), this);
toggleStakingAction->setStatusTip(tr("Toggle Staking"));

historyAction = new QAction(platformStyle->SingleColorIcon(":/icons/history"), tr("&Transactions"), this);
Expand All @@ -378,7 +375,7 @@ void BitcoinGUI::createActions()
historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
tabGroup->addAction(historyAction);

easysplitAction = new QAction(platformStyle->SingleColorIcon(":/icons/send_menu"), tr("&EasySplit"), this);
easysplitAction = new QAction(platformStyle->TextColorIcon(":/icons/send_menu"), tr("&EasySplit"), this);
easysplitAction->setStatusTip(tr("Split your Coins easily"));
easysplitAction->setToolTip(easysplitAction->statusTip());
easysplitAction->setCheckable(true);
Expand All @@ -396,7 +393,7 @@ void BitcoinGUI::createActions()
optionPageAction->setCheckable(true);
tabGroup->addAction(optionPageAction);

settingsMenuAction = new QAction(platformStyle->SingleColorIcon(":/icons/settings_menu"), optionPageAction->text(), this);
settingsMenuAction = new QAction(platformStyle->TextColorIcon(":/icons/settings_menu"), optionPageAction->text(), this);
settingsMenuAction->setStatusTip(optionPageAction->statusTip());
settingsMenuAction->setToolTip(settingsMenuAction->statusTip());

Expand Down Expand Up @@ -425,7 +422,8 @@ void BitcoinGUI::createActions()

connect(optionPageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(optionPageAction, SIGNAL(triggered()), this, SLOT(gotoSettingsPage()));
connect(settingsMenuAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));

//connect(SettingsMenuAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(settingsMenuAction, SIGNAL(triggered()), this, SLOT(gotoSettingsPage()));

#endif // ENABLE_WALLET
Expand All @@ -434,7 +432,7 @@ void BitcoinGUI::createActions()
quitAction->setStatusTip(tr("Quit application"));
quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
quitAction->setMenuRole(QAction::QuitRole);
quitMenuAction = new QAction(platformStyle->SingleColorIcon(":/icons/logout_menu"), quitAction->text(), this);
quitMenuAction = new QAction(platformStyle->TextColorIcon(":/icons/logout_menu"), quitAction->text(), this);
quitMenuAction->setStatusTip(quitAction->statusTip());
quitMenuAction->setToolTip(quitMenuAction->statusTip());
quitMenuAction->setMenuRole(QAction::QuitRole);
Expand Down Expand Up @@ -489,15 +487,14 @@ void BitcoinGUI::createActions()
showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Trezarcoin command-line options").arg(tr(PACKAGE_NAME)));

connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(quitMenuAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(quitMenuAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden()));
connect(showHelpMessageAction, SIGNAL(triggered()), this, SLOT(showHelpMessageClicked()));
connect(openRPCConsoleAction, SIGNAL(triggered()), this, SLOT(showDebugWindow()));
// prevents an open debug window from becoming stuck/unusable on client shutdown
connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide()));
connect(quitMenuAction, SIGNAL(triggered()), rpcConsole, SLOT(hide()));

#ifdef ENABLE_WALLET
if(walletFrame)
Expand Down Expand Up @@ -584,11 +581,14 @@ void BitcoinGUI::createToolBars()
QLabel* syncLabel = new QLabel();
QLabel* emptyLabel = new QLabel();
toolbar->setIconSize(QSize(80, 80));
syncLabel->setPixmap(platformStyle->SingleColorIcon(":/icons/tzc_green_space").pixmap(108, 180));
syncLabel->setPixmap(platformStyle->SingleColorIcon(":/icons/tzc_green").pixmap(108, 108));
syncLabel->setAlignment(Qt::AlignCenter);
emptyLabel->setPixmap(platformStyle->SingleColorIcon(":/icons/none").pixmap(60, 60));
emptyLabel->setAlignment(Qt::AlignCenter);
QWidget* spacer = new QWidget();
spacer->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
addToolBar(Qt::LeftToolBarArea, toolbar);
toolbar->addWidget(emptyLabel);
toolbar->addWidget(syncLabel);
toolbar->setMovable(false);
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
Expand Down Expand Up @@ -951,7 +951,7 @@ void BitcoinGUI::setNumConnections(int count)
case 7: case 8: case 9: icon = ":/icons/connect_3"; break;
default: icon = ":/icons/connect_4"; break;
}
labelConnectionsIcon->setPixmap(platformStyle->SingleColorIcon(icon).pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelConnectionsIcon->setPixmap(platformStyle->TextColorIcon(icon).pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelConnectionsIcon->setToolTip(tr("%n active connection(s) to Trezarcoin network", "", count));
}

Expand Down Expand Up @@ -1002,7 +1002,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
if(secs < 90*60)
{
tooltip = tr("Up to date") + QString(".<br>") + tooltip;
labelBlocksIcon->setPixmap(platformStyle->SingleColorIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
labelBlocksIcon->setPixmap(platformStyle->TextColorIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));

tooltip += QString("<br>") + tr("The current PoW difficulty is %1").arg(GetDifficulty());
tooltip += QString("<br>") + tr("The current PoS difficulty is %1").arg(GetDifficulty(GetLastBlockIndex(chainActive.Tip(), true)));
Expand Down Expand Up @@ -1059,7 +1059,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
tooltip = tr("Catching up...") + QString("<br>") + tooltip;
if(count != prevBlocks)
{
labelBlocksIcon->setPixmap(platformStyle->SingleColorIcon(QString(
labelBlocksIcon->setPixmap(platformStyle->TextColorIcon(QString(
":/movies/spinner-%1").arg(spinnerFrame, 3, 10, QChar('0')))
.pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
spinnerFrame = (spinnerFrame + 1) % SPINNER_FRAMES;
Expand Down Expand Up @@ -1257,7 +1257,7 @@ void BitcoinGUI::setEncryptionStatus(int status)
{
if(fWalletUnlockStakingOnly)
{
labelEncryptionIcon->setPixmap(QIcon(":/icons/lock_closed").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelEncryptionIcon->setPixmap(platformStyle->TextColorIcon(":/icons/lock_closed").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked for staking only</b>"));
changePassphraseAction->setEnabled(false);
unlockWalletAction->setVisible(false);
Expand All @@ -1280,7 +1280,7 @@ void BitcoinGUI::setEncryptionStatus(int status)
break;
case WalletModel::Unlocked:
labelEncryptionIcon->show();
labelEncryptionIcon->setPixmap(platformStyle->SingleColorIcon(":/icons/lock_open").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
labelEncryptionIcon->setPixmap(platformStyle->TextColorIcon(":/icons/lock_open").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
unlockWalletAction->setVisible(false);
encryptWalletAction->setChecked(true);
Expand Down
12 changes: 9 additions & 3 deletions src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *platformStyle, QWidget
platformStyle(platformStyle)
{
ui->setupUi(this);
/* Open CSS when configured TRAadd */
this->setStyleSheet(GUIUtil::loadStyleSheet());

// context menu actions
QAction *copyAddressAction = new QAction(tr("Copy address"), this);
Expand Down Expand Up @@ -104,6 +106,7 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *platformStyle, QWidget
ui->labelCoinControlPriority->addAction(clipboardPriorityAction);
ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction);
ui->labelCoinControlChange->addAction(clipboardChangeAction);


// toggle tree/list mode
connect(ui->radioTreeMode, SIGNAL(toggled(bool)), this, SLOT(radioTreeMode(bool)));
Expand Down Expand Up @@ -467,6 +470,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
}
}


QString sPriorityLabel = tr("none");
CAmount nAmount = 0;
CAmount nPayFee = 0;
Expand Down Expand Up @@ -626,7 +630,8 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
l2->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAmount)); // Amount
l3->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nPayFee)); // Fee
l4->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAfterFee)); // After Fee
l5->setText(((nBytes > 0) ? ASYMP_UTF8 : "") + QString::number(nBytes)); // Bytes
l5->setStyleSheet("color:blue;");// Bytes >= 1000
l5->setText(((nBytes > 0) ? ASYMP_UTF8 : "") + QString::number(nBytes)); // Bytes
l6->setText(sPriorityLabel); // Priority
l7->setText(fDust ? tr("yes") : tr("no")); // Dust
l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange)); // Change
Expand All @@ -638,8 +643,9 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
l8->setText(ASYMP_UTF8 + l8->text());
}

// turn labels "red"
l5->setStyleSheet((nBytes >= MAX_FREE_TRANSACTION_CREATE_SIZE) ? "color:red;" : "");// Bytes >= 1000

// turn labels "red"
l5->setStyleSheet((nBytes >= MAX_FREE_TRANSACTION_CREATE_SIZE) ? "color:red;" : "");// Bytes >= 1000
l6->setStyleSheet((dPriority > 0 && !fAllowFree) ? "color:red;" : ""); // Priority < "medium"
l7->setStyleSheet((fDust) ? "color:red;" : ""); // Dust = "yes"

Expand Down
Loading