may be a bit better quit handling
This commit is contained in:
parent
c708c33a92
commit
802e2f11a1
7 changed files with 46 additions and 12 deletions
|
@ -2,6 +2,10 @@
|
|||
#include "ui_pageappearance.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStandardPaths>
|
||||
#include <QDir>
|
||||
|
||||
static const QStringList filters = {"*.colors"};
|
||||
|
||||
PageAppearance::PageAppearance(QWidget* parent):
|
||||
QWidget(parent),
|
||||
|
@ -28,6 +32,17 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PageAppearance::~PageAppearance()
|
||||
|
|
|
@ -21,6 +21,16 @@
|
|||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="themeInput"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="colorInput"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="colorLabel">
|
||||
<property name="text">
|
||||
<string>Color scheme</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue