1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-22 10:42:29 +01:00

Change preview font to Noto Sans Light

Move colors to member
This commit is contained in:
Elias Steurer 2023-11-23 11:38:36 +01:00
parent 0185d6d952
commit 972bdc6db3
2 changed files with 11 additions and 3 deletions

View File

@ -2,6 +2,7 @@
#pragma once
#include <QColor>
#include <QDir>
#include <QFile>
#include <QFileInfo>
@ -117,5 +118,12 @@ private:
private:
QFuture<void> m_wizardFuture;
QVector<QColor> m_gradientColors = {
QColor("#B71C1C"),
QColor("#1B5E20"),
QColor("#0D47A1"),
QColor("#FFD600"),
QColor("#4A148C")
};
};
}

View File

@ -511,14 +511,13 @@ void Wizards::createPreviewImage(const QString& name, const QString& targetPath)
// Step 2: Select Random Colors (example colors, replace with Material colors)
// These are just placeholder colors, replace with actual Material colors
QColor colors[] = { QColor("#B71C1C"), QColor("#1B5E20"), QColor("#0D47A1"), QColor("#FFD600"), QColor("#4A148C") };
int randomIndex1 = QRandomGenerator::global()->bounded(5);
int randomIndex2 = QRandomGenerator::global()->bounded(5);
// Step 3: Create and Set Gradient
QLinearGradient gradient(QPointF(0, image.height()), QPointF(image.width(), 0));
gradient.setColorAt(0, colors[randomIndex1].darker()); // Dark color
gradient.setColorAt(1, colors[randomIndex2].lighter()); // Bright color
gradient.setColorAt(0, m_gradientColors[randomIndex1].darker()); // Dark color
gradient.setColorAt(1, m_gradientColors[randomIndex2].lighter()); // Bright color
painter.fillRect(image.rect(), gradient);
@ -527,6 +526,7 @@ void Wizards::createPreviewImage(const QString& name, const QString& targetPath)
painter.setPen(Qt::white);
int fontSize = qMin(image.width(), image.height()) / 10; // Adjust proportion as needed
QFont font = painter.font();
font.setFamily("Noto Sans Light");
font.setPointSize(fontSize);
painter.setFont(font);