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
Prev Previous commit
Next Next commit
Ui changes
  • Loading branch information
rausi authored Sep 5, 2019
commit aa52e0c7aa4fe909e55499b94e8e90005da64168
25 changes: 14 additions & 11 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
#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);
QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
MacDockIconHandler::instance()->setIcon(networkStyle->getAppIcon());
#endif
setWindowTitle(windowTitle);
Expand Down Expand Up @@ -274,7 +274,12 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
walletFrame->setStakingStatus(tr("Staking is turned off."),false);
}

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


progressBarLabel = new QLabel();
progressBarLabel->setVisible(false);
progressBar = new GUIUtil::ProgressBar();
Expand All @@ -289,12 +294,13 @@ 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: 7px; margin: 0px; }");
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; }");
//}


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

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

QActionGroup *tabGroup = new QActionGroup(this);

emptyAction = new QAction(platformStyle->SingleColorIcon(":/icons/none"), tr(""), this);
emptyAction = new QAction(platformStyle->SingleColorIcon(":/icons/spacerBlock"), tr(""), this);
emptyAction->setCheckable(false);
emptyAction->setEnabled(false);
tabGroup->addAction(emptyAction);
Expand Down Expand Up @@ -422,8 +428,7 @@ 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 Down Expand Up @@ -487,14 +492,15 @@ 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 @@ -581,14 +587,11 @@ void BitcoinGUI::createToolBars()
QLabel* syncLabel = new QLabel();
QLabel* emptyLabel = new QLabel();
toolbar->setIconSize(QSize(80, 80));
syncLabel->setPixmap(platformStyle->SingleColorIcon(":/icons/tzc_green").pixmap(108, 108));
syncLabel->setPixmap(platformStyle->SingleColorIcon(":/icons/tzc_green_space").pixmap(108, 180));
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
11 changes: 4 additions & 7 deletions src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *platformStyle, QWidget
platformStyle(platformStyle)
{
ui->setupUi(this);
/* Open CSS when configured TRAadd */
this->setStyleSheet(GUIUtil::loadStyleSheet());
/* Open CSS when configured */
this->setStyleSheet(GUIUtil::loadStyleSheet());

// context menu actions
QAction *copyAddressAction = new QAction(tr("Copy address"), this);
Expand Down Expand Up @@ -106,7 +106,6 @@ 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 @@ -470,7 +469,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
}
}


QString sPriorityLabel = tr("none");
CAmount nAmount = 0;
CAmount nPayFee = 0;
Expand Down Expand Up @@ -642,9 +640,8 @@ 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
3 changes: 3 additions & 0 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,12 @@ void OverviewPage::setBalance(const CAmount& balance, const CAmount& unconfirmed
currentWatchImmatureBalance = watchImmatureBalance;
//ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balance, false, BitcoinUnits::separatorAlways));
ui->labelUnconfirmed->setText(BitcoinUnits::format(unit, unconfirmedBalance, false, BitcoinUnits::separatorAlways));
//ui->labelUnconfirmed->setStyleSheet("QLabel {font-size:16pt; color:#dceaed; }");
//ui->labelStaking->setText(BitcoinUnits::formatWithUnit(unit, stakingBalance, false, BitcoinUnits::separatorAlways));
//ui->labelImmature->setText(BitcoinUnits::formatWithUnit(unit, immatureBalance, false, BitcoinUnits::separatorAlways));
//ui->labelTotal->setText(BitcoinUnits::formatWithUnitGreen(unit,balance + unconfirmedBalance + stakingBalance, false, BitcoinUnits::separatorAlways));
ui->labelTotal->setText(BitcoinUnits::format(unit,balance + unconfirmedBalance + stakingBalance, false, BitcoinUnits::separatorAlways));
//ui->labelTotal->setStyleSheet("QLabel {font-size:25pt; color:#dceaed; }");

bool showStaking = stakingBalance != 0;

Expand Down