- enhancement: new sky blue icon set, contributed by Alan-CRL
This commit is contained in:
parent
428a079b7f
commit
fffa210a69
|
@ -1,3 +1,12 @@
|
||||||
## Contributor of Icons
|
## Contributor of Icons
|
||||||
beanflame@github
|
|
||||||
XiaoLoong@github
|
- beanflame@github
|
||||||
|
- XiaoLoong@github
|
||||||
|
|
||||||
|
### devcpp.svg
|
||||||
|
|
||||||
|
author: beanflame@github
|
||||||
|
|
||||||
|
### Icon set Blue Sky
|
||||||
|
|
||||||
|
author: Alan-CRL
|
2
NEWS.md
2
NEWS.md
|
@ -3,6 +3,8 @@ Red Panda C++ Version 0.14.1
|
||||||
- fix: failed to show function tip, when there are parameters having '[' and ']'
|
- fix: failed to show function tip, when there are parameters having '[' and ']'
|
||||||
- enhancement: display localized theme name in the option dialog
|
- enhancement: display localized theme name in the option dialog
|
||||||
- enhancement: show custom theme folder in options dialog -> enviroment -> folders
|
- enhancement: show custom theme folder in options dialog -> enviroment -> folders
|
||||||
|
- enhancement: display localzed icon set name in the option dialog
|
||||||
|
- enhancement: new sky blue icon set, contributed by Alan-CRL
|
||||||
|
|
||||||
Red Panda C++ Version 0.14.0
|
Red Panda C++ Version 0.14.0
|
||||||
- enhancement: custom icon set ( in the configuration folder)
|
- enhancement: custom icon set ( in the configuration folder)
|
||||||
|
|
|
@ -24,6 +24,9 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QDirIterator>
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
|
@ -293,3 +296,33 @@ void IconsManager::setIconSetsFolder(const QString &newIconSetsFolder)
|
||||||
{
|
{
|
||||||
mIconSetsFolder = newIconSetsFolder;
|
mIconSetsFolder = newIconSetsFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<PIconSet> IconsManager::listIconSets()
|
||||||
|
{
|
||||||
|
QDirIterator dirIter(iconSetsFolder());
|
||||||
|
QList<PIconSet> result;
|
||||||
|
while(dirIter.hasNext()) {
|
||||||
|
dirIter.next();
|
||||||
|
QFileInfo fileInfo = dirIter.fileInfo();
|
||||||
|
if (!fileInfo.isHidden() && fileInfo.isDir()) {
|
||||||
|
PIconSet pSet = std::make_shared<IconSet>();
|
||||||
|
pSet->name = fileInfo.baseName();
|
||||||
|
pSet->displayName = pSet->name;
|
||||||
|
QFile infoFile(includeTrailingPathDelimiter(fileInfo.absoluteFilePath())+"info.json");
|
||||||
|
if (infoFile.exists() && infoFile.open(QFile::ReadOnly)) {
|
||||||
|
QByteArray content = infoFile.readAll();
|
||||||
|
QJsonParseError error;
|
||||||
|
QJsonDocument doc(QJsonDocument::fromJson(content,&error));
|
||||||
|
if (error.error == QJsonParseError::NoError) {
|
||||||
|
QJsonObject obj=doc.object();
|
||||||
|
pSet->displayName = obj["name"].toString();
|
||||||
|
QString localeName = obj["name_"+pSettings->environment().language()].toString();
|
||||||
|
if (!localeName.isEmpty())
|
||||||
|
pSet->displayName = localeName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.append(pSet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
|
@ -23,6 +23,13 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "parser/parserutils.h"
|
#include "parser/parserutils.h"
|
||||||
|
|
||||||
|
struct IconSet {
|
||||||
|
QString name;
|
||||||
|
QString displayName;
|
||||||
|
};
|
||||||
|
|
||||||
|
using PIconSet = std::shared_ptr<IconSet>;
|
||||||
|
|
||||||
class QToolButton;
|
class QToolButton;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
class IconsManager : public QObject
|
class IconsManager : public QObject
|
||||||
|
@ -170,6 +177,8 @@ public:
|
||||||
const QString iconSetsFolder() const;
|
const QString iconSetsFolder() const;
|
||||||
void setIconSetsFolder(const QString &newIconSetsFolder);
|
void setIconSetsFolder(const QString &newIconSetsFolder);
|
||||||
|
|
||||||
|
QList<PIconSet> listIconSets();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void actionIconsUpdated();
|
void actionIconsUpdated();
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "../settings.h"
|
#include "../settings.h"
|
||||||
#include "../mainwindow.h"
|
#include "../mainwindow.h"
|
||||||
#include "../thememanager.h"
|
#include "../thememanager.h"
|
||||||
|
#include "../iconsmanager.h"
|
||||||
|
|
||||||
EnvironmentAppearenceWidget::EnvironmentAppearenceWidget(const QString& name, const QString& group, QWidget *parent) :
|
EnvironmentAppearenceWidget::EnvironmentAppearenceWidget(const QString& name, const QString& group, QWidget *parent) :
|
||||||
SettingsWidget(name,group,parent),
|
SettingsWidget(name,group,parent),
|
||||||
|
@ -45,7 +46,12 @@ void EnvironmentAppearenceWidget::doLoad()
|
||||||
}
|
}
|
||||||
ui->cbFont->setCurrentFont(QFont(pSettings->environment().interfaceFont()));
|
ui->cbFont->setCurrentFont(QFont(pSettings->environment().interfaceFont()));
|
||||||
ui->spinFontSize->setValue(pSettings->environment().interfaceFontSize());
|
ui->spinFontSize->setValue(pSettings->environment().interfaceFontSize());
|
||||||
ui->cbIconSet->setCurrentText(pSettings->environment().iconSet());
|
for (int i=0; i<ui->cbIconSet->count();i++) {
|
||||||
|
if (ui->cbIconSet->itemData(i) == pSettings->environment().iconSet()) {
|
||||||
|
ui->cbIconSet->setCurrentIndex(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
ui->chkUseCustomIconSet->setChecked(pSettings->environment().useCustomIconSet());
|
ui->chkUseCustomIconSet->setChecked(pSettings->environment().useCustomIconSet());
|
||||||
ui->chkUseCustomTheme->setChecked(pSettings->environment().useCustomTheme());
|
ui->chkUseCustomTheme->setChecked(pSettings->environment().useCustomTheme());
|
||||||
|
|
||||||
|
@ -71,7 +77,7 @@ void EnvironmentAppearenceWidget::doSave()
|
||||||
pSettings->environment().setInterfaceFont(ui->cbFont->currentFont().family());
|
pSettings->environment().setInterfaceFont(ui->cbFont->currentFont().family());
|
||||||
pSettings->environment().setInterfaceFontSize(ui->spinFontSize->value());
|
pSettings->environment().setInterfaceFontSize(ui->spinFontSize->value());
|
||||||
pSettings->environment().setLanguage(ui->cbLanguage->currentData().toString());
|
pSettings->environment().setLanguage(ui->cbLanguage->currentData().toString());
|
||||||
pSettings->environment().setIconSet(ui->cbIconSet->currentText());
|
pSettings->environment().setIconSet(ui->cbIconSet->currentData().toString());
|
||||||
pSettings->environment().setUseCustomIconSet(ui->chkUseCustomIconSet->isChecked());
|
pSettings->environment().setUseCustomIconSet(ui->chkUseCustomIconSet->isChecked());
|
||||||
pSettings->environment().setUseCustomTheme(ui->chkUseCustomTheme->isChecked());
|
pSettings->environment().setUseCustomTheme(ui->chkUseCustomTheme->isChecked());
|
||||||
|
|
||||||
|
@ -89,6 +95,9 @@ void EnvironmentAppearenceWidget::init()
|
||||||
}
|
}
|
||||||
ui->cbLanguage->addItem(tr("English"),"en");
|
ui->cbLanguage->addItem(tr("English"),"en");
|
||||||
ui->cbLanguage->addItem(tr("Simplified Chinese"),"zh_CN");
|
ui->cbLanguage->addItem(tr("Simplified Chinese"),"zh_CN");
|
||||||
ui->cbIconSet->addItem("newlook");
|
QList<PIconSet> iconSets = pIconsManager->listIconSets();
|
||||||
|
foreach(const PIconSet& iconSet, iconSets) {
|
||||||
|
ui->cbIconSet->addItem(iconSet->displayName,iconSet->name);
|
||||||
|
}
|
||||||
SettingsWidget::init();
|
SettingsWidget::init();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue