forked from blue/squawk
new optional KDE Frameworks plugin to support system color schemes
This commit is contained in:
parent
802e2f11a1
commit
0ff9f12157
8 changed files with 130 additions and 10 deletions
|
@ -33,16 +33,19 @@ PageAppearance::PageAppearance(QWidget* parent):
|
|||
|
||||
connect(m_ui->themeInput, qOverload<int>(&QComboBox::currentIndexChanged), this, &PageAppearance::onThemeChanged);
|
||||
|
||||
m_ui->colorInput->addItem(tr("System"));
|
||||
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "color-schemes", QStandardPaths::LocateDirectory);
|
||||
QStringList schemeFiles;
|
||||
for (const QString &dir : dirs) {
|
||||
const QStringList fileNames = QDir(dir).entryList(filters);
|
||||
for (const QString &file : fileNames) {
|
||||
m_ui->colorInput->addItem(dir + QDir::separator() + file);
|
||||
if (Shared::Global::supported("colorSchemeTools")) {
|
||||
m_ui->colorInput->addItem(tr("System"));
|
||||
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "color-schemes", QStandardPaths::LocateDirectory);
|
||||
QStringList schemeFiles;
|
||||
for (const QString &dir : dirs) {
|
||||
const QStringList fileNames = QDir(dir).entryList(filters);
|
||||
for (const QString &file : fileNames) {
|
||||
m_ui->colorInput->addItem(Shared::Global::createThemePreview(dir + QDir::separator() + file), file);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m_ui->colorInput->setEnabled(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PageAppearance::~PageAppearance()
|
||||
|
@ -55,3 +58,5 @@ void PageAppearance::onThemeChanged(int index)
|
|||
emit variableModified("theme", styles[index]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#include <QSettings>
|
||||
#include <vector>
|
||||
|
||||
#include "shared/global.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class PageAppearance;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue