Fixed white logo on startup #319

This commit is contained in:
xarkes 2018-02-12 13:22:53 +01:00
parent b229513620
commit 524be44dc2
4 changed files with 19 additions and 7 deletions

View File

@ -59,9 +59,7 @@ NewFileDialog::NewFileDialog(QWidget *parent) :
setAcceptDrops(true);
ui->recentsListWidget->addAction(ui->actionRemove_item);
ui->recentsListWidget->addAction(ui->actionClear_all);
QString logoFile = (palette().window().color().value() < 127) ? ":/img/cutter_white_plain.svg" : ":/img/cutter_plain.svg";
ui->logoSvgWidget->load(logoFile);
ui->logoSvgWidget->load(Config()->getLogoFile());
fillRecentFilesList();
bool projectsExist = fillProjectsList();

View File

@ -24,10 +24,7 @@ OptionsDialog::OptionsDialog(MainWindow *main):
ui->progressBar->setVisible(0);
ui->statusLabel->setVisible(0);
ui->elapsedLabel->setVisible(0);
QString logoFile = (palette().window().color().value() < 127) ? ":/img/cutter_white_plain.svg" : ":/img/cutter_plain.svg";
ui->logoSvgWidget->load(logoFile);
ui->logoSvgWidget->load(Config()->getLogoFile());
ui->analSlider->setValue(defaultAnalLevel);
// Fill the plugins combo

View File

@ -128,6 +128,9 @@ void Configuration::loadDefaultTheme()
/* Load Qt Theme */
qApp->setStyleSheet("");
/* Images */
logoFile = QString(":/img/cutter_plain.svg");
}
void Configuration::loadDarkTheme()
@ -243,6 +246,9 @@ void Configuration::loadDarkTheme()
#endif
qApp->setStyleSheet(stylesheet);
}
/* Images */
logoFile = QString(":/img/cutter_white_plain.svg");
}
const QFont Configuration::getFont() const
@ -277,6 +283,11 @@ const QColor Configuration::getColor(const QString &name) const
}
}
QString Configuration::getLogoFile()
{
return logoFile;
}
/**
* @brief Configuration::setColor sets the local Cutter configuration color
* and the radare2 color.

View File

@ -22,6 +22,9 @@ private:
void loadDarkTheme();
void setColor(const QString &name, const QColor &color);
// Images
QString logoFile;
public:
// Functions
Configuration();
@ -38,6 +41,9 @@ public:
void setDarkTheme(bool set);
bool getDarkTheme() { return s.value("dark").toBool(); }
// Images
QString getLogoFile();
// Graph
int getGraphBlockMaxChars() const { return s.value("graph.maxcols", 50).toInt(); }
void setGraphBlockMaxChars(int ch) { s.setValue("graph.maxcols", ch); }