nicerer firmware color picker

also consistency aaaaaaaaaa
This commit is contained in:
Arisotura 2021-11-17 14:53:46 +01:00
parent c6d1977448
commit 53dfcfb18a
2 changed files with 39 additions and 12 deletions

View File

@ -20,6 +20,7 @@
#include "FirmwareSettingsDialog.h" #include "FirmwareSettingsDialog.h"
#include "ui_FirmwareSettingsDialog.h" #include "ui_FirmwareSettingsDialog.h"
FirmwareSettingsDialog* FirmwareSettingsDialog::currentDlg = nullptr; FirmwareSettingsDialog* FirmwareSettingsDialog::currentDlg = nullptr;
FirmwareSettingsDialog::FirmwareSettingsDialog(QWidget* parent) : QDialog(parent), ui(new Ui::FirmwareSettingsDialog) FirmwareSettingsDialog::FirmwareSettingsDialog(QWidget* parent) : QDialog(parent), ui(new Ui::FirmwareSettingsDialog)
@ -35,7 +36,13 @@ FirmwareSettingsDialog::FirmwareSettingsDialog(QWidget* parent) : QDialog(parent
QDate birthDate = QDate(QDate::currentDate().year(), Config::FirmwareBirthdayMonth, Config::FirmwareBirthdayDay); QDate birthDate = QDate(QDate::currentDate().year(), Config::FirmwareBirthdayMonth, Config::FirmwareBirthdayDay);
ui->birthdayEdit->setDate(birthDate); ui->birthdayEdit->setDate(birthDate);
ui->colorsEdit->addItems(colours); for (int i = 0; i < 16; i++)
{
QImage image(16, 16, QImage::Format_ARGB32);
image.fill(colors[i]);
QIcon icon(QPixmap::fromImage(image.copy()));
ui->colorsEdit->addItem(icon, colornames[i]);
}
ui->colorsEdit->setCurrentIndex(Config::FirmwareFavouriteColour); ui->colorsEdit->setCurrentIndex(Config::FirmwareFavouriteColour);
ui->messageEdit->setText(Config::FirmwareMessage); ui->messageEdit->setText(Config::FirmwareMessage);

View File

@ -30,24 +30,44 @@ class FirmwareSettingsDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
const QStringList colours const QStringList colornames
{ {
"Greyish Blue", "Greyish blue",
"Brown", "Brown",
"Red", "Red",
"Light Pink", "Light pink",
"Orange", "Orange",
"Yellow", "Yellow",
"Lime", "Lime",
"Light Green", "Light green",
"Dark Green", "Dark green",
"Turqoise", "Turquoise",
"Light Blue", "Light blue",
"Blue", "Blue",
"Dark Blue", "Dark blue",
"Dark Purple", "Dark purple",
"Light Purple", "Light purple",
"Dark Pink" "Dark pink"
};
const QColor colors[16] =
{
QColor(97, 130, 154),
QColor(186, 73, 0),
QColor(251, 0, 24),
QColor(251, 138, 251),
QColor(251, 146, 0),
QColor(243, 227, 0),
QColor(170, 251, 0),
QColor(0, 251, 0),
QColor(0, 162, 56),
QColor(73, 219, 138),
QColor(48, 186, 243),
QColor(0, 89, 243),
QColor(0, 0, 146),
QColor(138, 0, 211),
QColor(211, 0, 235),
QColor(251, 0, 246)
}; };
const QStringList languages const QStringList languages