Cockatrice/cockatrice/src/interface/widgets/onboarding/pages/theme_setup_page.h
BruebachL 2b7b4e8168
Some checks are pending
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (actions) (push) Waiting to run
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 26 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Docker / Servatrice (arm) (push) Waiting to run
Build Docker / Servatrice (x86) (push) Waiting to run
Build Docker / Publish multi-platform Servatrice image (push) Blocked by required conditions
[App] Add onboarding wizard (#7064)
* [App] Add onboarding wizard

Took 10 minutes

Took 3 minutes

Took 7 minutes

Took 9 minutes

Took 2 minutes

Took 1 minute


Took 7 minutes

* Adjust CI

Took 14 minutes

Took 56 seconds

Took 2 seconds

Took 3 seconds

* Adjust CI again

Took 14 minutes

Took 2 seconds

* Comments and fixes

Took 9 seconds


Took 1 minute

* Rebase.

Took 5 minutes

Took 50 seconds

Took 15 seconds

* Comments.

Took 7 minutes

* CI lol

Took 3 minutes

* CI again lol

Took 4 minutes

* Drop some settings, add some new ones.

Took 19 minutes

* Resize when expanding section

Took 4 minutes

Took 3 minutes

Took 7 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-08-24 23:05:58 +02:00

58 lines
1.9 KiB
C++

#ifndef THEME_SETUP_PAGE_H
#define THEME_SETUP_PAGE_H
#include "../first_run_wizard_page.h"
class QComboBox;
class QGroupBox;
class QuickSetupPanel;
/** @brief First-run theme step. Reuses the same building blocks as Appearance
* settings and the Palette Editor (ThemeManager, PaletteConfig,
* PaletteGenerator, and the QuickSetupPanel widget itself) rather than
* reimplementing palette generation or preview here.
*
* Behavior specific to this page (deliberately not pushed down into
* ThemeManager, to avoid changing app-wide behaviour for existing installs):
* - Opening the page never changes the running palette; previews and
* auto-generation only happen when the user actually changes a control.
* - If a theme+scheme the user selects has no saved palette and no shipped
* default, one is generated from the QuickSetupPanel's current accent so
* the preview doesn't fall back to a flat, unstyled look. */
class ThemeSetupPage : public FirstRunWizardPage
{
Q_OBJECT
public:
explicit ThemeSetupPage(QWidget *parent = nullptr);
void initializePage() override;
bool validatePage() override;
bool isSkippable() const override;
QString stepTitle() const override;
QString stepSubtitle() const override;
void retranslateUi() override;
private slots:
void onThemeChanged(int index);
void onSchemeChanged();
void onGenerateFromAccent(const QColor &accent, int intensity);
void onHomeTabBackgroundChanged(int index);
private:
QString currentScheme() const;
QString resolvedScheme() const; // "System" -> actual Light/Dark
void maybeAutoGeneratePalette();
QString writableThemeDir() const;
QComboBox *themeCombo;
QComboBox *schemeCombo;
QGroupBox *accentGroup;
QuickSetupPanel *quickSetupPanel;
QComboBox *homeTabBackgroundCombo;
bool paletteDirty = false;
};
#endif // THEME_SETUP_PAGE_H