From ed58e8752043cb9166d0849653ccfb261bf7a8ab Mon Sep 17 00:00:00 2001 From: BlackAngelTV Date: Wed, 16 Sep 2026 22:34:32 +0200 Subject: [PATCH] style(ui): match the interface to the FWS website's design system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- pages/browse-page.cpp | 23 ++- pages/cleanup-page.cpp | 4 +- pages/dashboard-page.cpp | 16 +- pages/history-page.cpp | 11 +- pages/plugins-page.cpp | 12 +- pages/ui-kit.cpp | 10 +- plugins/example-addon/example-addon.cpp | 2 +- resources/icons/alert.svg | 2 +- resources/icons/arrow-up.svg | 2 +- resources/icons/broom.svg | 2 +- resources/icons/check.svg | 2 +- resources/icons/close.svg | 2 +- resources/icons/filter.svg | 2 +- resources/icons/history.svg | 2 +- resources/icons/home.svg | 2 +- resources/icons/logs.svg | 2 +- resources/icons/package.svg | 2 +- resources/icons/plugin.svg | 2 +- resources/icons/refresh.svg | 2 +- resources/icons/search.svg | 2 +- resources/icons/tools.svg | 2 +- resources/icons/trash.svg | 2 +- src/main-window.cpp | 261 ++++++++++++++---------- 23 files changed, 208 insertions(+), 161 deletions(-) diff --git a/pages/browse-page.cpp b/pages/browse-page.cpp index a190d78..ec7ba20 100644 --- a/pages/browse-page.cpp +++ b/pages/browse-page.cpp @@ -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")); diff --git a/pages/cleanup-page.cpp b/pages/cleanup-page.cpp index b83f7a2..1a6f5e0 100644 --- a/pages/cleanup-page.cpp +++ b/pages/cleanup-page.cpp @@ -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& 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); diff --git a/pages/dashboard-page.cpp b/pages/dashboard-page.cpp index c69b663..28ca7f6 100644 --- a/pages/dashboard-page.cpp +++ b/pages/dashboard-page.cpp @@ -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(); diff --git a/pages/history-page.cpp b/pages/history-page.cpp index b2cd028..25a5845 100644 --- a/pages/history-page.cpp +++ b/pages/history-page.cpp @@ -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(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, diff --git a/pages/plugins-page.cpp b/pages/plugins-page.cpp index 559bc41..148e938 100644 --- a/pages/plugins-page.cpp +++ b/pages/plugins-page.cpp @@ -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); diff --git a/pages/ui-kit.cpp b/pages/ui-kit.cpp index 6e20129..f730739 100644 --- a/pages/ui-kit.cpp +++ b/pages/ui-kit.cpp @@ -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; } diff --git a/plugins/example-addon/example-addon.cpp b/plugins/example-addon/example-addon.cpp index e02723d..4cc582e 100644 --- a/plugins/example-addon/example-addon.cpp +++ b/plugins/example-addon/example-addon.cpp @@ -41,7 +41,7 @@ public: if (!m_loaded || !m_window) return; m_badge = new QLabel("⚡ Exemple d'addon actif"); m_badge->setStyleSheet( - "color: #7aa2f7; font-size: 11px; font-weight: 600; padding-right: 8px;"); + "color: #38bdf8; font-size: 11px; font-weight: 600; padding-right: 8px;"); m_window->statusBar()->addPermanentWidget(m_badge); } diff --git a/resources/icons/alert.svg b/resources/icons/alert.svg index b9dc49c..a5addca 100644 --- a/resources/icons/alert.svg +++ b/resources/icons/alert.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/icons/arrow-up.svg b/resources/icons/arrow-up.svg index 75e9754..5e65be0 100644 --- a/resources/icons/arrow-up.svg +++ b/resources/icons/arrow-up.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/resources/icons/broom.svg b/resources/icons/broom.svg index 6a51a34..6594ddd 100644 --- a/resources/icons/broom.svg +++ b/resources/icons/broom.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/icons/check.svg b/resources/icons/check.svg index 7ec1105..d8beaf8 100644 --- a/resources/icons/check.svg +++ b/resources/icons/check.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/resources/icons/close.svg b/resources/icons/close.svg index 7421cf7..6ab1654 100644 --- a/resources/icons/close.svg +++ b/resources/icons/close.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/resources/icons/filter.svg b/resources/icons/filter.svg index d43529f..056b7fc 100644 --- a/resources/icons/filter.svg +++ b/resources/icons/filter.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/resources/icons/history.svg b/resources/icons/history.svg index 4a5b8e8..44b10bd 100644 --- a/resources/icons/history.svg +++ b/resources/icons/history.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/resources/icons/home.svg b/resources/icons/home.svg index 87b2d0b..2f57ad1 100644 --- a/resources/icons/home.svg +++ b/resources/icons/home.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/icons/logs.svg b/resources/icons/logs.svg index 5227a03..ca7d89c 100644 --- a/resources/icons/logs.svg +++ b/resources/icons/logs.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/icons/package.svg b/resources/icons/package.svg index 6e928d0..2e63385 100644 --- a/resources/icons/package.svg +++ b/resources/icons/package.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/icons/plugin.svg b/resources/icons/plugin.svg index 55a6b18..a2e0128 100644 --- a/resources/icons/plugin.svg +++ b/resources/icons/plugin.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/icons/refresh.svg b/resources/icons/refresh.svg index b5aae87..99e0f87 100644 --- a/resources/icons/refresh.svg +++ b/resources/icons/refresh.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/icons/search.svg b/resources/icons/search.svg index 09ea18b..65cecd7 100644 --- a/resources/icons/search.svg +++ b/resources/icons/search.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/resources/icons/tools.svg b/resources/icons/tools.svg index a79c4a1..b06c7a8 100644 --- a/resources/icons/tools.svg +++ b/resources/icons/tools.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/resources/icons/trash.svg b/resources/icons/trash.svg index 46b3915..2ee8112 100644 --- a/resources/icons/trash.svg +++ b/resources/icons/trash.svg @@ -1,4 +1,4 @@ - + diff --git a/src/main-window.cpp b/src/main-window.cpp index db07656..b36f8b3 100644 --- a/src/main-window.cpp +++ b/src/main-window.cpp @@ -75,142 +75,176 @@ static QString actionErrorTitle(const QString& action) { // Everything the screens draw with. The look of the application is a single // stylesheet applied to the window, so a screen file only describes its layout // and its wording (see pages/ui-kit.h for the shared widgets). +// +// The palette and the shapes mirror the FWS website's stylesheets +// (p/assets/styles/var.css, styles.css and paquets.css): slate surfaces on a +// #0f172a page, a sky-blue accent, serif headings, pill-shaped badges and +// 8-16px radii. The site draws its borders and tints with rgba() over the +// surface below; a Qt stylesheet only takes a solid colour, so those values are +// pre-blended here onto the surface they sit on (#232c3f is the site's border +// over the page, #303b4e the same border over a card). static QString appStyleSheet() { return QStringLiteral( // ---- Base ---- - "QMainWindow, QWidget { background: #0d1017; color: #dbe2f0; }" + // Widgets stay transparent like in CSS: only real surfaces declare a + // background, so the page glow below shows through the layouts. The + // dialogs are listed explicitly because they are windows of their own + // and would otherwise fall back to the light system palette. + "QMainWindow, QDialog { background: #0f172a; }" + "QWidget { color: #e2e8f0; }" + // The site tints its dark page with a soft accent glow from the top + // left; Qt has no radial gradient, so a diagonal one stands in for it. + "QWidget#content {" + " background: qlineargradient(x1:0, y1:0, x2:0.85, y2:1," + " stop:0 #13243b, stop:0.55 #0f172a, stop:1 #0f172a);" + "}" // ---- Sidebar ---- - "QFrame#sidebar { background: #11151d; border-right: 1px solid #1d2432; }" + // A raised surface, like the site's header and footer. + "QFrame#sidebar { background: #1e293b; border-right: 1px solid #232c3f; }" "QWidget#logo { padding: 4px 0; }" - "QLabel#logoText { font-size: 16px; font-weight: 800; color: #ffffff; }" - "QLabel#tagline { font-size: 11px; color: #6b7285; padding: 0 8px 8px 8px; }" + "QLabel#logoText { font-family: serif; font-size: 19px; font-weight: 700; color: #e2e8f0; }" + "QLabel#tagline { font-size: 11px; color: #64748b; padding: 0 8px 8px 8px; }" + // Navigation entries use the site's navigation idiom: a rounded shape + // that fills with the accent tint, the label turning accent. "QPushButton[nav=\"true\"] {" " text-align: left;" " background: transparent;" - " border: none;" - " border-left: 3px solid transparent;" + " border: 1px solid transparent;" " border-radius: 8px;" - " padding: 9px 10px 9px 13px;" + " padding: 9px 12px;" " font-size: 13px;" " font-weight: 600;" - " color: #98a0b3;" + " color: #94a3b8;" "}" - "QPushButton[nav=\"true\"]:hover { background: #1a2130; color: #e8edf9; }" - "QPushButton[nav=\"true\"]:checked { background: #1c2434; border-left: 3px solid #7aa2f7; color: #ffffff; }" - "QPushButton[nav=\"true\"]:disabled { color: #565f73; }" + "QPushButton[nav=\"true\"]:hover { background: #21384e; color: #7dd3fc; }" + "QPushButton[nav=\"true\"]:checked { background: #21384e; color: #38bdf8; }" + "QPushButton[nav=\"true\"]:disabled { color: #475569; }" // ---- Header ---- - "QWidget#header { background: #0f1219; border-bottom: 1px solid #1d2432; }" - "QLabel#headerTitle { font-size: 19px; font-weight: 800; color: #e8edf9; }" - "QLabel#headerSubtitle { font-size: 12px; color: #7a8299; }" + "QWidget#header { background: #1e293b; border-bottom: 1px solid #232c3f; }" + "QLabel#headerTitle { font-family: serif; font-size: 21px; font-weight: 700; color: #e2e8f0; }" + "QLabel#headerSubtitle { font-size: 12px; color: #94a3b8; }" // ---- Cards ---- - // Cards read as raised surfaces: a slightly lighter background, a hair - // line border and a rounded corner separate them from the page without - // adding shadows Qt cannot render consistently across platforms. + // Cards read as raised surfaces: the site's slightly lighter slate, a + // hair line border and a rounded corner separate them from the page + // without adding shadows Qt cannot render consistently across + // platforms. "QFrame#card {" - " background: #121722;" - " border: 1px solid #1d2432;" + " background: #1e293b;" + " border: 1px solid #232c3f;" " border-radius: 12px;" "}" // Stat cards carry a coloured left edge so the four metrics are told - // apart at a glance. - "QFrame#card[accent=\"blue\"] { border-left: 3px solid #7aa2f7; }" - "QFrame#card[accent=\"amber\"] { border-left: 3px solid #e0af68; }" - "QFrame#card[accent=\"cyan\"] { border-left: 3px solid #56b6c2; }" - "QFrame#card[accent=\"green\"] { border-left: 3px solid #3fb950; }" - "QLabel#cardTitle { font-size: 11px; font-weight: 700; color: #7a8299; letter-spacing: 1px; }" - "QLabel#statValue { font-size: 32px; font-weight: 800; color: #ffffff; }" - "QLabel#statTitle { font-size: 12px; color: #7a8299; font-weight: 600; }" + // apart at a glance. The colours are the site's status and accent ones. + "QFrame#card[accent=\"blue\"] { border-left: 3px solid #38bdf8; }" + "QFrame#card[accent=\"amber\"] { border-left: 3px solid #fbbf24; }" + "QFrame#card[accent=\"cyan\"] { border-left: 3px solid #7dd3fc; }" + "QFrame#card[accent=\"green\"] { border-left: 3px solid #34d399; }" + // Small uppercase labels, as the site's section headings. + "QLabel#cardTitle { font-size: 11px; font-weight: 700; color: #64748b; letter-spacing: 1px; }" + "QLabel#statValue { font-size: 30px; font-weight: 800; color: #e2e8f0; }" + "QLabel#statTitle { font-size: 12px; color: #94a3b8; font-weight: 600; }" // ---- Sidebar extras ---- "QLabel#sectionTitle {" " font-size: 10px;" " font-weight: 800;" - " color: #4d5566;" + " color: #64748b;" " letter-spacing: 1.2px;" " padding: 14px 10px 2px 10px;" "}" - "QLabel#versionLabel { font-size: 11px; color: #565f73; padding: 8px 10px; }" - "QPushButton[nav=\"true\"][highlighted=\"true\"] { color: #e0af68; }" + "QLabel#versionLabel { font-size: 11px; color: #64748b; padding: 8px 10px; }" + "QPushButton[nav=\"true\"][highlighted=\"true\"] { color: #fbbf24; }" // ---- Buttons ---- + // Mirrors the site's .button: rounded, 1px transparent border that + // takes the accent when hovered, and a darker fill on hover. "QPushButton {" - " background: #232b3a;" - " color: #dbe2f0;" - " border: none;" + " background: #273449;" + " color: #94a3b8;" + " border: 1px solid #303b4e;" " border-radius: 8px;" " padding: 8px 16px;" " font-size: 13px;" " font-weight: 600;" "}" - "QPushButton:hover { background: #2c3648; }" - "QPushButton:pressed { background: #1e2634; }" - "QPushButton:disabled { background: #181d28; color: #565f73; }" - "QPushButton[variant=\"primary\"] { background: #7aa2f7; color: #0d1017; }" - "QPushButton[variant=\"primary\"]:hover { background: #8ab0ff; }" - "QPushButton[variant=\"primary\"]:pressed { background: #5f86d9; }" - "QPushButton[variant=\"primary\"]:disabled { background: #2a3350; color: #7a8299; }" - "QPushButton[variant=\"success\"] { background: #3fb950; color: #0d1017; }" - "QPushButton[variant=\"success\"]:hover { background: #4ecb5f; }" - "QPushButton[variant=\"success\"]:pressed { background: #35a344; }" - "QPushButton[variant=\"success\"]:disabled { background: #1d2b21; color: #5f7a66; }" - "QPushButton[variant=\"danger\"] { background: #f7768e; color: #0d1017; }" - "QPushButton[variant=\"danger\"]:hover { background: #ff8ba4; }" - "QPushButton[variant=\"danger\"]:pressed { background: #e05e78; }" - "QPushButton[variant=\"danger\"]:disabled { background: #2c1c21; color: #7a5f66; }" - "QPushButton[variant=\"warning\"] { background: #e0af68; color: #0d1017; }" - "QPushButton[variant=\"warning\"]:hover { background: #ecc27e; }" - "QPushButton[variant=\"warning\"]:pressed { background: #d09a50; }" - "QPushButton[variant=\"warning\"]:disabled { background: #2b241c; color: #7a6d5c; }" - "QPushButton[variant=\"info\"] { background: #56b6c2; color: #0d1017; }" - "QPushButton[variant=\"info\"]:hover { background: #6cc7d2; }" - "QPushButton[variant=\"info\"]:pressed { background: #45a3ae; }" - "QPushButton[variant=\"info\"]:disabled { background: #1c2a2d; color: #5f7a7d; }" + "QPushButton:hover { background: #29445e; border-color: #7dd3fc; color: #38bdf8; }" + "QPushButton:pressed { background: #22384d; color: #7dd3fc; }" + "QPushButton:disabled { background: #232c3f; border-color: transparent; color: #64748b; }" + "QPushButton[variant=\"primary\"] { background: #38bdf8; border-color: transparent; color: #0f172a; }" + "QPushButton[variant=\"primary\"]:hover { background: #0ea5e9; color: #0f172a; }" + "QPushButton[variant=\"primary\"]:pressed { background: #0284c7; color: #0f172a; }" + "QPushButton[variant=\"success\"] { background: #34d399; border-color: transparent; color: #0f172a; }" + "QPushButton[variant=\"success\"]:hover { background: #10b981; color: #0f172a; }" + "QPushButton[variant=\"success\"]:pressed { background: #059669; color: #0f172a; }" + "QPushButton[variant=\"danger\"] { background: #f87171; border-color: transparent; color: #0f172a; }" + "QPushButton[variant=\"danger\"]:hover { background: #ef4444; color: #0f172a; }" + "QPushButton[variant=\"danger\"]:pressed { background: #dc2626; color: #0f172a; }" + "QPushButton[variant=\"warning\"] { background: #fbbf24; border-color: transparent; color: #0f172a; }" + "QPushButton[variant=\"warning\"]:hover { background: #f59e0b; color: #0f172a; }" + "QPushButton[variant=\"warning\"]:pressed { background: #d97706; color: #0f172a; }" + "QPushButton[variant=\"info\"] { background: #7dd3fc; border-color: transparent; color: #0f172a; }" + "QPushButton[variant=\"info\"]:hover { background: #38bdf8; color: #0f172a; }" + "QPushButton[variant=\"info\"]:pressed { background: #0ea5e9; color: #0f172a; }" + // A disabled button keeps the muted fill of the site's :disabled rule, + // whatever its variant. + "QPushButton[variant=\"primary\"]:disabled, QPushButton[variant=\"success\"]:disabled," + "QPushButton[variant=\"danger\"]:disabled, QPushButton[variant=\"warning\"]:disabled," + "QPushButton[variant=\"info\"]:disabled {" + " background: #232c3f; border-color: transparent; color: #64748b;" + "}" // ---- Inputs ---- "QLineEdit {" - " background: #141927;" - " border: 1px solid #2a3448;" - " border-radius: 10px;" + " background: #1e293b;" + " border: 1px solid #303b4e;" + " border-radius: 8px;" " padding: 9px 14px;" " font-size: 13px;" - " color: #dbe2f0;" - " selection-background-color: #7aa2f7;" + " color: #e2e8f0;" + " selection-background-color: #38bdf8;" + " selection-color: #0f172a;" "}" - "QLineEdit:focus { border: 1px solid #7aa2f7; }" - "QLineEdit:disabled { color: #565f73; }" + "QLineEdit:hover { border-color: #475569; }" + "QLineEdit:focus { border: 1px solid #38bdf8; }" + "QLineEdit:disabled { color: #64748b; }" "QComboBox {" - " background: #141927;" - " border: 1px solid #2a3448;" - " border-radius: 10px;" + " background: #1e293b;" + " border: 1px solid #303b4e;" + " border-radius: 8px;" " padding: 7px 12px;" " font-size: 13px;" - " color: #dbe2f0;" + " color: #e2e8f0;" "}" + "QComboBox:hover { border-color: #7dd3fc; }" "QComboBox::drop-down { border: none; width: 26px; }" "QComboBox QAbstractItemView {" - " background: #141927;" - " border: 1px solid #2a3448;" - " selection-background-color: #232c44;" - " color: #dbe2f0;" + " background: #273449;" + " border: 1px solid #303b4e;" + " selection-background-color: #21384e;" + " selection-color: #38bdf8;" + " color: #e2e8f0;" "}" // ---- Progress bar ---- - "QProgressBar { background: #1c2330; border: none; border-radius: 3px; }" - "QProgressBar::chunk { background: #7aa2f7; border-radius: 3px; }" + "QProgressBar { background: #273449; border: none; border-radius: 3px; }" + "QProgressBar::chunk { background: #38bdf8; border-radius: 3px; }" // ---- Package table ---- - // No outer frame: the table blends with the page background, keeping + // No outer frame: the table blends with the card it sits in, keeping // only the column header and alternating rows as visual separators. "QTableWidget {" " background: transparent;" - " alternate-background-color: #141a25;" + " alternate-background-color: #223044;" " border: none;" " gridline-color: transparent;" " outline: 0;" "}" "QTableWidget::item { border: none; padding: 4px 8px; }" - "QTableWidget::item:selected { background: #232c44; color: #ffffff; }" - "QTableWidget::item:hover { background: #1a2130; }" + "QTableWidget::item:selected { background: #21384e; color: #e2e8f0; }" + // Hover stays below the selection tint, so a hovered row is never + // mistaken for the selected one. + "QTableWidget::item:hover { background: #1b2b40; }" + "QHeaderView { background: transparent; }" "QHeaderView::section {" - " background: #1a2130;" - " color: #7a8299;" + " background: transparent;" + " color: #64748b;" " border: none;" - " border-bottom: 1px solid #232b3a;" + " border-bottom: 1px solid #303b4e;" " padding: 8px;" " font-size: 11px;" " font-weight: 700;" @@ -219,43 +253,61 @@ static QString appStyleSheet() { // ---- Recent activity list ---- "QListWidget#recentList { background: transparent; border: none; outline: 0; }" "QListWidget#recentList::item { border-radius: 8px; margin: 1px 2px; }" - "QListWidget#recentList::item:hover { background: #1a2130; }" + "QListWidget#recentList::item:hover { background: #21384e; }" // ---- Logs editor ---- + // Recessed like the site's inline code: the page colour, not a card. "QTextEdit {" - " background: #12161f;" - " color: #c8d3f5;" - " border: 1px solid #232b3a;" - " border-radius: 10px;" + " background: #0f172a;" + " color: #e2e8f0;" + " border: 1px solid #303b4e;" + " border-radius: 12px;" " padding: 10px;" " font-family: monospace;" " font-size: 13px;" "}" + // ---- Menus ---- + // The menu strip shares the header's surface, so the two read as the + // site's single top band. + "QMenuBar { background: #1e293b; color: #94a3b8; padding: 2px 4px; }" + "QMenuBar::item { padding: 6px 10px; border-radius: 6px; background: transparent; }" + "QMenuBar::item:selected { background: #21384e; color: #38bdf8; }" + "QMenu {" + " background: #1e293b;" + " color: #e2e8f0;" + " border: 1px solid #303b4e;" + " border-radius: 8px;" + " padding: 6px;" + "}" + "QMenu::item { padding: 7px 24px 7px 14px; border-radius: 6px; }" + "QMenu::item:selected { background: #21384e; color: #38bdf8; }" + "QMenu::item:disabled { color: #64748b; }" + "QMenu::separator { height: 1px; background: #303b4e; margin: 6px 8px; }" // ---- Scrollbars ---- "QScrollBar:vertical { background: transparent; width: 10px; margin: 2px; }" - "QScrollBar::handle:vertical { background: #2a3448; border-radius: 5px; min-height: 30px; }" - "QScrollBar::handle:vertical:hover { background: #3a455c; }" + "QScrollBar::handle:vertical { background: #273449; border-radius: 5px; min-height: 30px; }" + "QScrollBar::handle:vertical:hover { background: #38bdf8; }" "QScrollBar:horizontal { background: transparent; height: 10px; margin: 2px; }" - "QScrollBar::handle:horizontal { background: #2a3448; border-radius: 5px; min-width: 30px; }" - "QScrollBar::handle:horizontal:hover { background: #3a455c; }" + "QScrollBar::handle:horizontal { background: #273449; border-radius: 5px; min-width: 30px; }" + "QScrollBar::handle:horizontal:hover { background: #38bdf8; }" "QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical," "QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal { height: 0; width: 0; }" "QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical," "QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal { background: transparent; }" // ---- Status bar ---- "QStatusBar {" - " background: #0f1219;" - " color: #7a8299;" - " border-top: 1px solid #1d2432;" + " background: #1e293b;" + " color: #94a3b8;" + " border-top: 1px solid #232c3f;" " font-size: 12px;" "}" // ---- Splitter ---- "QSplitter::handle { background: transparent; }" // ---- Tooltips ---- "QToolTip {" - " background: #1c2434;" - " color: #e8edf9;" - " border: 1px solid #2a3448;" - " border-radius: 6px;" + " background: #273449;" + " color: #e2e8f0;" + " border: 1px solid #303b4e;" + " border-radius: 8px;" " padding: 4px 8px;" "}"); } @@ -588,22 +640,9 @@ void MainWindow::notifyUpdatesAvailable(int count) { } void MainWindow::setupMenuBar() { + // The menu bar and its menus are styled by the window stylesheet + // (appStyleSheet), which also covers the tray menu. QMenuBar* menuBar = this->menuBar(); - menuBar->setStyleSheet( - "QMenuBar { background: #0d1017; color: #c8d3f5; padding: 2px 8px; }" - "QMenuBar::item { padding: 6px 10px; border-radius: 6px; background: transparent; }" - "QMenuBar::item:selected { background: #232b3a; }" - "QMenu {" - " background: #141927;" - " color: #dbe2f0;" - " border: 1px solid #2a3448;" - " border-radius: 8px;" - " padding: 6px;" - "}" - "QMenu::item { padding: 7px 24px 7px 14px; border-radius: 6px; }" - "QMenu::item:selected { background: #7aa2f7; color: #0d1017; }" - "QMenu::separator { height: 1px; background: #2a3448; margin: 6px 8px; }" - ); auto goTo = [this](int navId) { if (QAbstractButton* button = m_navGroup->button(navId)) button->click();