Themeability (#186)

* add css (qss)

* Include css

* Merge pull request #6 from Fair-Exchange/css

Css

* fix

* beta blue

* fix

* YellowFevers UI work

* Merge pull request #7 from Fair-Exchange/css

Css - YellowFevers UI work

* Update mainwindow.cpp

* Update mainwindow.ui

* Merge pull request #6 from OleksandrBlack/css

move Tx list to balance tab

* Ease of use

General usability improvements

* Delete main.css

* style for tab

* Merge pull request #7 from YellowFeveRs/UI-work

General UI improvements

* updated tab styling

* Merge pull request #8 from Fair-Exchange/css

Css

* fix

* fix for Windows

* fix for Windows

* fix

* Merge pull request #10 from Fair-Exchange/master

Merge pull request #4 from OleksandrBlack/master

* Merge pull request #10 from Fair-Exchange/master

Merge pull request #4 from OleksandrBlack/master

* Merge pull request #11 from OleksandrBlack/css

Css

* Merge pull request #12 from OleksandrBlack/style

blue prepare

* revert

* Update zec_qt_wallet_zh.ts

* Update zec_qt_wallet_es.ts

* Update zec_qt_wallet_fr.ts

* Update zec_qt_wallet_it.ts

* Update zec_qt_wallet_pt.ts

* Update json.hpp

* Update json.hpp

* Update about.ui

* Update mainwindow.ui

* Update connection.ui

* Update connection.cpp

* Update connection.cpp

* Update application.qrc

* Update mainwindow.cpp

* Update settings.ui
This commit is contained in:
earthorbit
2019-09-27 11:27:15 -06:00
committed by adityapk00
parent 77585cf20a
commit e7b08612fa
19 changed files with 2120 additions and 67 deletions

View File

@@ -29,6 +29,22 @@ MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
// Include css
QString theme_name;
try
{
theme_name = Settings::getInstance()->get_theme_name();
}
catch (...)
{
theme_name = "default";
}
this->slot_change_theme(theme_name);
ui->setupUi(this);
logger = new Logger(this, QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)).filePath("zec-qt-wallet.log"));
@@ -116,6 +132,7 @@ MainWindow::MainWindow(QWidget *parent) :
// Initialize to the balances tab
ui->tabWidget->setCurrentIndex(0);
// The zcashd tab is hidden by default, and only later added in if the embedded zcashd is started
zcashdtab = ui->tabWidget->widget(4);
ui->tabWidget->removeTab(4);
@@ -484,6 +501,12 @@ void MainWindow::setupSettingsModal() {
}
});
// Setup theme combo
int theme_index = settings.comboBoxTheme->findText(Settings::getInstance()->get_theme_name(), Qt::MatchExactly);
settings.comboBoxTheme->setCurrentIndex(theme_index);
QObject::connect(settings.comboBoxTheme, SIGNAL(currentIndexChanged(QString)), this, SLOT(slot_change_theme(QString)));
// Save sent transactions
settings.chkSaveTxs->setChecked(Settings::getInstance()->getSaveZtxs());
@@ -1602,6 +1625,35 @@ void MainWindow::updateLabels() {
updateLabelsAutoComplete();
}
void MainWindow::slot_change_theme(const QString& theme_name)
{
/*
QMessageBox msgBox;
msgBox.setText(theme_name);
msgBox.exec();
*/
Settings::getInstance()->set_theme_name(theme_name);
// Include css
QString saved_theme_name;
try
{
saved_theme_name = Settings::getInstance()->get_theme_name();
}
catch (...)
{
saved_theme_name = "default";
}
QFile qFile(":/css/res/css/" + saved_theme_name +".css");
if (qFile.open(QFile::ReadOnly))
{
QString styleSheet = QLatin1String(qFile.readAll());
this->setStyleSheet(styleSheet);
}
}
MainWindow::~MainWindow()
{
delete ui;