style(ui): match the interface to the FWS website's design system
The window carried a palette of its own, so the desktop app and the site looked like two different products. The stylesheet now uses the website's tokens (slate surfaces on a #0f172a page, sky-blue accent, serif headings, pill-shaped badges); the site's rgba() borders are pre-blended because a Qt stylesheet only takes solid colours, and plain widgets are left transparent so the page glow shows through them. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
1 parent
5720c398ef
commit
ed58e87520
23 files changed
+208
-161
No files matched your search
+13
-10
@@ -62,7 +62,7 @@ BrowsePage::BrowsePage(AppCore* core, QWidget* parent) : Page(core, parent) {
|
||||
filterRow->addWidget(m_filterBar, 1);
|
||||
|
||||
QLabel* filterHint = new QLabel("Filtre local, instantané");
|
||||
filterHint->setStyleSheet("font-size: 12px; color: #7a8299;");
|
||||
filterHint->setStyleSheet("font-size: 12px; color: #64748b;");
|
||||
filterRow->addWidget(filterHint);
|
||||
|
||||
m_filterRow->setVisible(false);
|
||||
@@ -164,12 +164,15 @@ BrowsePage::BrowsePage(AppCore* core, QWidget* parent) : Page(core, parent) {
|
||||
|
||||
m_pkgName = new QLabel("Sélectionnez un paquet");
|
||||
m_pkgName->setWordWrap(true);
|
||||
// Serif like the site's package headings.
|
||||
m_pkgName->setStyleSheet(
|
||||
"font-size: 22px; font-weight: 700; color: #e8edf9; background: transparent;");
|
||||
"font-family: serif; font-size: 22px; font-weight: 700; color: #e2e8f0;"
|
||||
"background: transparent;");
|
||||
detailsLayout->addWidget(m_pkgName);
|
||||
|
||||
m_pkgVersion = new QLabel("");
|
||||
m_pkgVersion->setStyleSheet("font-size: 13px; color: #7a8299; background: transparent;");
|
||||
m_pkgVersion->setStyleSheet(
|
||||
"font-size: 13px; color: #94a3b8; background: transparent;");
|
||||
detailsLayout->addWidget(m_pkgVersion);
|
||||
|
||||
QHBoxLayout* metaRow = new QHBoxLayout();
|
||||
@@ -178,8 +181,8 @@ BrowsePage::BrowsePage(AppCore* core, QWidget* parent) : Page(core, parent) {
|
||||
auto makeMetaBadge = [](QLabel** out) {
|
||||
QLabel* label = new QLabel("—");
|
||||
label->setStyleSheet(
|
||||
"background: #1c2434; color: #7a8299; border-radius: 10px;"
|
||||
"padding: 3px 12px; font-size: 12px;");
|
||||
"background: #273449; color: #94a3b8; border: 1px solid #303b4e;"
|
||||
"border-radius: 999px; padding: 3px 12px; font-size: 12px;");
|
||||
*out = label;
|
||||
return label;
|
||||
};
|
||||
@@ -192,14 +195,14 @@ BrowsePage::BrowsePage(AppCore* core, QWidget* parent) : Page(core, parent) {
|
||||
QFrame* separator = new QFrame();
|
||||
separator->setFrameShape(QFrame::HLine);
|
||||
separator->setStyleSheet(
|
||||
"color: #232b3a; background: #232b3a; max-height: 1px; border: none;");
|
||||
"color: #303b4e; background: #303b4e; max-height: 1px; border: none;");
|
||||
detailsLayout->addWidget(separator);
|
||||
|
||||
m_pkgDescription = new QLabel("");
|
||||
m_pkgDescription->setWordWrap(true);
|
||||
m_pkgDescription->setAlignment(Qt::AlignTop | Qt::AlignLeft);
|
||||
m_pkgDescription->setStyleSheet(
|
||||
"font-size: 14px; color: #c8d3f5; background: transparent;");
|
||||
"font-size: 14px; color: #94a3b8; background: transparent;");
|
||||
detailsLayout->addWidget(m_pkgDescription, 1);
|
||||
|
||||
detailsLayout->addStretch();
|
||||
@@ -401,15 +404,15 @@ void BrowsePage::addRow(int row, const PackageInfo& pkg) {
|
||||
|
||||
QTableWidgetItem* providerItem =
|
||||
new QTableWidgetItem(ui::providersLabel(core()->plugins(), pkg));
|
||||
providerItem->setForeground(QColor("#7a8299"));
|
||||
providerItem->setForeground(QColor("#94a3b8"));
|
||||
m_table->setItem(row, 3, providerItem);
|
||||
|
||||
QTableWidgetItem* statusItem = new QTableWidgetItem(ui::packageStatusText(pkg));
|
||||
if (pkg.installed && pkg.updateAvailable) {
|
||||
statusItem->setForeground(QColor("#e0af68"));
|
||||
statusItem->setForeground(QColor("#fbbf24"));
|
||||
statusItem->setIcon(ui::icon("arrow-up"));
|
||||
} else if (pkg.installed) {
|
||||
statusItem->setForeground(QColor("#3fb950"));
|
||||
statusItem->setForeground(QColor("#34d399"));
|
||||
statusItem->setIcon(ui::icon("check"));
|
||||
} else {
|
||||
statusItem->setIcon(ui::icon("package"));
|
||||
|
||||
@@ -33,7 +33,7 @@ CleanupPage::CleanupPage(AppCore* core, QWidget* parent) : Page(core, parent) {
|
||||
"manuelle : vérifiez-les un par un avant de les supprimer.");
|
||||
hint->setTextFormat(Qt::RichText);
|
||||
hint->setWordWrap(true);
|
||||
hint->setStyleSheet("font-size: 12px; color: #7a8299;");
|
||||
hint->setStyleSheet("font-size: 12px; color: #94a3b8;");
|
||||
hintLayout->addWidget(hint);
|
||||
|
||||
layout->addWidget(hintCard);
|
||||
@@ -133,7 +133,7 @@ void CleanupPage::populate(const std::vector<PackageInfo>& candidates) {
|
||||
|
||||
QTableWidgetItem* typeItem =
|
||||
new QTableWidgetItem(QString::fromStdString(pkg.cleanupReason));
|
||||
typeItem->setForeground(QColor(pkg.orphan ? "#e0af68" : "#7a8299"));
|
||||
typeItem->setForeground(QColor(pkg.orphan ? "#fbbf24" : "#94a3b8"));
|
||||
typeItem->setIcon(ui::icon(pkg.orphan ? "alert" : "package"));
|
||||
m_table->setItem(i, 2, typeItem);
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ DashboardPage::DashboardPage(AppCore* core, QWidget* parent) : Page(core, parent
|
||||
m_statUpdates->setText(QString::number(results.size()));
|
||||
m_statUpdates->setStyleSheet(results.empty()
|
||||
? QString()
|
||||
: QString("color: #e0af68;"));
|
||||
: QString("color: #fbbf24;"));
|
||||
}
|
||||
});
|
||||
connect(core, &AppCore::historyChanged, this, &DashboardPage::refresh);
|
||||
@@ -165,24 +165,26 @@ void DashboardPage::refreshRecentActivity() {
|
||||
|
||||
QLabel* timestamp = new QLabel(QString::fromStdString(entry.timestamp));
|
||||
timestamp->setStyleSheet(
|
||||
"background: transparent; color: #5f6785;"
|
||||
"background: transparent; color: #64748b;"
|
||||
"font-family: monospace; font-size: 12px;");
|
||||
rowLayout->addWidget(timestamp);
|
||||
|
||||
// Badge colours are the site's status colours, each one tinted onto the
|
||||
// card background the badge sits on.
|
||||
QString actionText, actionBg, actionFg;
|
||||
if (entry.action == "install") {
|
||||
actionText = "Installation"; actionBg = "#12301f"; actionFg = "#3fb950";
|
||||
actionText = "Installation"; actionBg = "#213d46"; actionFg = "#34d399";
|
||||
} else if (entry.action == "remove") {
|
||||
actionText = "Suppression"; actionBg = "#3a1a1a"; actionFg = "#f7768e";
|
||||
actionText = "Suppression"; actionBg = "#383241"; actionFg = "#f87171";
|
||||
} else if (entry.action == "cleanup") {
|
||||
actionText = "Nettoyage"; actionBg = "#12333a"; actionFg = "#56b6c2";
|
||||
actionText = "Nettoyage"; actionBg = "#213b52"; actionFg = "#7dd3fc";
|
||||
} else {
|
||||
actionText = "Mise à jour"; actionBg = "#3d2f0f"; actionFg = "#e0af68";
|
||||
actionText = "Mise à jour"; actionBg = "#393b38"; actionFg = "#fbbf24";
|
||||
}
|
||||
rowLayout->addWidget(ui::badge(actionText, actionBg, actionFg));
|
||||
|
||||
QLabel* package = new QLabel(QString::fromStdString(entry.package));
|
||||
package->setStyleSheet("background: transparent; font-weight: 600; color: #c8d3f5;");
|
||||
package->setStyleSheet("background: transparent; font-weight: 600; color: #e2e8f0;");
|
||||
rowLayout->addWidget(package);
|
||||
|
||||
rowLayout->addStretch();
|
||||
|
||||
@@ -24,7 +24,7 @@ HistoryPage::HistoryPage(AppCore* core, QWidget* parent) : Page(core, parent) {
|
||||
filterRow->setSpacing(10);
|
||||
|
||||
QLabel* filterLabel = new QLabel("Filtrer :");
|
||||
filterLabel->setStyleSheet("font-size: 13px; color: #7a8299;");
|
||||
filterLabel->setStyleSheet("font-size: 13px; color: #94a3b8;");
|
||||
filterRow->addWidget(filterLabel);
|
||||
|
||||
m_filter = new QComboBox();
|
||||
@@ -95,15 +95,16 @@ void HistoryPage::refreshTable() {
|
||||
for (int i = 0; i < static_cast<int>(entries.size()); ++i) {
|
||||
const auto& entry = entries[i];
|
||||
|
||||
// The site's status colours, one per action kind.
|
||||
QString actionText, actionColor;
|
||||
if (entry.action == "install") {
|
||||
actionText = "Installation"; actionColor = "#3fb950";
|
||||
actionText = "Installation"; actionColor = "#34d399";
|
||||
} else if (entry.action == "remove") {
|
||||
actionText = "Suppression"; actionColor = "#f7768e";
|
||||
actionText = "Suppression"; actionColor = "#f87171";
|
||||
} else if (entry.action == "cleanup") {
|
||||
actionText = "Nettoyage"; actionColor = "#56b6c2";
|
||||
actionText = "Nettoyage"; actionColor = "#7dd3fc";
|
||||
} else {
|
||||
actionText = "Mise à jour"; actionColor = "#e0af68";
|
||||
actionText = "Mise à jour"; actionColor = "#fbbf24";
|
||||
}
|
||||
|
||||
m_table->setItem(i, 0,
|
||||
|
||||
@@ -35,7 +35,7 @@ PluginsPage::PluginsPage(AppCore* core, QWidget* parent) : Page(core, parent) {
|
||||
"~/.local/share/PacManager/plugins/ ou dans le dossier plugins/ à côté de "
|
||||
"l'exécutable, puis cliquez sur « Recharger ».");
|
||||
hint->setWordWrap(true);
|
||||
hint->setStyleSheet("font-size: 12px; color: #7a8299;");
|
||||
hint->setStyleSheet("font-size: 12px; color: #94a3b8;");
|
||||
hintLayout->addWidget(hint);
|
||||
|
||||
layout->addWidget(hintCard);
|
||||
@@ -48,7 +48,7 @@ PluginsPage::PluginsPage(AppCore* core, QWidget* parent) : Page(core, parent) {
|
||||
m_description = new QLabel("");
|
||||
m_description->setWordWrap(true);
|
||||
m_description->setStyleSheet(
|
||||
"font-size: 13px; color: #c8d3f5; background: transparent; padding: 2px 4px;");
|
||||
"font-size: 13px; color: #94a3b8; background: transparent; padding: 2px 4px;");
|
||||
layout->addWidget(m_description);
|
||||
|
||||
QHBoxLayout* buttonBar = new QHBoxLayout();
|
||||
@@ -135,7 +135,7 @@ void PluginsPage::refreshTable() {
|
||||
: "Fournisseur";
|
||||
QTableWidgetItem* typeItem =
|
||||
new QTableWidgetItem(entry.info.builtin ? kindText : kindText + " (externe)");
|
||||
typeItem->setForeground(QColor("#7a8299"));
|
||||
typeItem->setForeground(QColor("#94a3b8"));
|
||||
m_table->setItem(i, 1, typeItem);
|
||||
|
||||
m_table->setItem(i, 2, new QTableWidgetItem(QString::fromStdString(entry.info.version)));
|
||||
@@ -145,13 +145,13 @@ void PluginsPage::refreshTable() {
|
||||
QColor statusColor;
|
||||
if (!entry.info.available) {
|
||||
statusText = "Indisponible";
|
||||
statusColor = QColor("#565f73");
|
||||
statusColor = QColor("#64748b");
|
||||
} else if (enabled) {
|
||||
statusText = "Actif";
|
||||
statusColor = QColor("#3fb950");
|
||||
statusColor = QColor("#34d399");
|
||||
} else {
|
||||
statusText = "Désactivé";
|
||||
statusColor = QColor("#e0af68");
|
||||
statusColor = QColor("#fbbf24");
|
||||
}
|
||||
|
||||
QTableWidgetItem* statusItem = new QTableWidgetItem(statusText);
|
||||
|
||||
+6
-4
@@ -18,11 +18,13 @@ QPixmap iconPixmap(const QString& name, int size) {
|
||||
return icon(name).pixmap(QSize(size, size));
|
||||
}
|
||||
|
||||
// A pill, like the website's .paquet-since / .nav-dropdown-version tags: a low
|
||||
// tint of a colour as background, the colour itself as text, fully rounded.
|
||||
QLabel* badge(const QString& text, const QString& background, const QString& foreground) {
|
||||
QLabel* label = new QLabel(text);
|
||||
label->setStyleSheet(QString(
|
||||
"background: %1; color: %2; border-radius: 9px;"
|
||||
"padding: 2px 9px; font-size: 11px; font-weight: 600;")
|
||||
"background: %1; color: %2; border-radius: 999px;"
|
||||
"padding: 2px 10px; font-size: 11px; font-weight: 700;")
|
||||
.arg(background, foreground));
|
||||
return label;
|
||||
}
|
||||
@@ -90,7 +92,7 @@ QStackedWidget* withEmptyState(QTableWidget* widget, const QString& hint) {
|
||||
QLabel* label = new QLabel(hint);
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
label->setWordWrap(true);
|
||||
label->setStyleSheet("background: transparent; color: #565f73; font-size: 13px;");
|
||||
label->setStyleSheet("background: transparent; color: #64748b; font-size: 13px;");
|
||||
layout->addWidget(label);
|
||||
layout->addStretch();
|
||||
stack->addWidget(placeholder);
|
||||
@@ -103,7 +105,7 @@ void showEmptyState(QStackedWidget* stack, bool empty) {
|
||||
|
||||
QLabel* countLabel() {
|
||||
QLabel* label = new QLabel();
|
||||
label->setStyleSheet("font-size: 12px; color: #7a8299; font-weight: 600;");
|
||||
label->setStyleSheet("font-size: 12px; color: #64748b; font-weight: 600;");
|
||||
return label;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user