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); setAcceptDrops(true);
ui->recentsListWidget->addAction(ui->actionRemove_item); ui->recentsListWidget->addAction(ui->actionRemove_item);
ui->recentsListWidget->addAction(ui->actionClear_all); ui->recentsListWidget->addAction(ui->actionClear_all);
ui->logoSvgWidget->load(Config()->getLogoFile());
QString logoFile = (palette().window().color().value() < 127) ? ":/img/cutter_white_plain.svg" : ":/img/cutter_plain.svg";
ui->logoSvgWidget->load(logoFile);
fillRecentFilesList(); fillRecentFilesList();
bool projectsExist = fillProjectsList(); bool projectsExist = fillProjectsList();

View File

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

View File

@ -128,6 +128,9 @@ void Configuration::loadDefaultTheme()
/* Load Qt Theme */ /* Load Qt Theme */
qApp->setStyleSheet(""); qApp->setStyleSheet("");
/* Images */
logoFile = QString(":/img/cutter_plain.svg");
} }
void Configuration::loadDarkTheme() void Configuration::loadDarkTheme()
@ -243,6 +246,9 @@ void Configuration::loadDarkTheme()
#endif #endif
qApp->setStyleSheet(stylesheet); qApp->setStyleSheet(stylesheet);
} }
/* Images */
logoFile = QString(":/img/cutter_white_plain.svg");
} }
const QFont Configuration::getFont() const 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 * @brief Configuration::setColor sets the local Cutter configuration color
* and the radare2 color. * and the radare2 color.

View File

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