Skip to content

Commit

Permalink
Update CSS and add restart warning
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapk00 authored and Sol committed Sep 30, 2019
1 parent ce6f462 commit 1194d12
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion res/css/dark.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QTableView::item, QScrollArea, QGroupBox, QPlainTextEdit, QLineEdit, QLabel
QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QTableView::item, QScrollArea, QGroupBox, QPlainTextEdit, QLineEdit, QLabel, MainWindow
{
background-color: #303335;
color: #ffffff;
Expand Down
2 changes: 1 addition & 1 deletion res/css/default.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QTableView::item, QScrollArea, QGroupBox, QPlainTextEdit, QLineEdit, QLabel
QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QTableView::item, QScrollArea, QGroupBox, QPlainTextEdit, QLineEdit, QLabel, MainWindow
{
/**/

Expand Down
2 changes: 1 addition & 1 deletion res/css/light.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QTableView::item, QScrollArea, QGroupBox, QWidget, QPlainTextEdit, QLineEdit, QLabel
QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QTableView::item, QScrollArea, QGroupBox, QWidget, QPlainTextEdit, QLineEdit, QLabel, MainWindow
{
background-color: #dadada;
color: #000000;
Expand Down
11 changes: 5 additions & 6 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,11 @@ void MainWindow::setupSettingsModal() {
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)));
QObject::connect(settings.comboBoxTheme, &QComboBox::currentTextChanged, [=] (QString theme_name) {
this->slot_change_theme(theme_name);
// Tell the user to restart
QMessageBox::information(this, tr("Restart"), tr("Please restart ZecWallet to have the theme apply"), QMessageBox::Ok);
});

// Save sent transactions
settings.chkSaveTxs->setChecked(Settings::getInstance()->getSaveZtxs());
Expand Down Expand Up @@ -1819,11 +1823,6 @@ void MainWindow::updateLabels() {

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
Expand Down

0 comments on commit 1194d12

Please sign in to comment.