may be a bit better quit handling

This commit is contained in:
Blue 2022-01-25 23:35:55 +03:00
parent c708c33a92
commit 802e2f11a1
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
7 changed files with 46 additions and 12 deletions

View file

@ -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()

View file

@ -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/>