1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

2257 Fix and Style comboBox fix

This commit is contained in:
bitok 2015-10-09 01:27:08 +03:00
parent e89b7e1c6d
commit aff85a7ea6
3 changed files with 15 additions and 4 deletions

View File

@ -106,7 +106,7 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
else
bodyUI->styleBrowser->setCurrentText(tr("None"));
for (QString color : Style::themeColorNames)
for (QString color : Style::getThemeColorNames())
bodyUI->themeColorCBox->addItem(color);
bodyUI->themeColorCBox->setCurrentIndex(Settings::getInstance().getThemeColor());
@ -482,4 +482,12 @@ void GeneralForm::retranslateUi()
int proxyType = bodyUI->proxyType->currentIndex();
bodyUI->retranslateUi(this);
bodyUI->proxyType->setCurrentIndex(proxyType);
QStringList colorThemes(Style::getThemeColorNames());
for (int i = 0; i != colorThemes.size(); ++i)
{
bodyUI->themeColorCBox->setItemText(i, colorThemes[i]);
}
bodyUI->styleBrowser->setItemText(0, tr("None"));
}

View File

@ -71,9 +71,12 @@ static QColor palette[] = {
static QMap<QString, QString> dict;
QStringList Style::themeColorNames = {QObject::tr("Default"), QObject::tr("Blue"), QObject::tr("Olive"), QObject::tr("Red"), QObject::tr("Violet")};
QList<QColor> Style::themeColorColors = {QColor(), QColor("#004aa4"), QColor("#97ba00"), QColor("#c23716"), QColor("#4617b5")};
QStringList Style::getThemeColorNames()
{
return {QObject::tr("Default"), QObject::tr("Blue"), QObject::tr("Olive"), QObject::tr("Red"), QObject::tr("Violet")};
}
QList<QColor> Style::themeColorColors = {QColor(), QColor("#004aa4"), QColor("#97ba00"), QColor("#c23716"), QColor("#4617b5")};
QString Style::getStylesheet(const QString &filename)
{

View File

@ -58,6 +58,7 @@ public:
SmallLight // [SystemDefault - 2]px, light
};
static QStringList getThemeColorNames();
static QString getStylesheet(const QString& filename);
static QColor getColor(ColorPalette entry);
static QFont getFont(Font font);
@ -68,7 +69,6 @@ public:
static void applyTheme(); ///< Reloads some CCS
static QPixmap scaleSvgImage(const QString& path, uint32_t width, uint32_t height);
static QStringList themeColorNames;
static QList<QColor> themeColorColors;
signals: