mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
* [Themes] Add identity default palettes for the image themes
The Fabric, Leather, Plasma and VelvetMarble themes shipped only zone art and no palette, so their chrome fell back to the bare OS palette. Each theme now ships light and dark curated defaults written in the palette editor's own conventions, with [AppColors] so the home-tab buttons keep the theme's identity over static backgrounds.
- Add palette-default-light.toml / palette-default-dark.toml for the four themes; scheme resolution follows the OS since the themes declare no color scheme.
- Tint the window/base/button chrome and bevels towards each theme's identity: navy cloth (Fabric), black-brown with brass accents (Leather), electric violet with cyan sparks (Plasma), charcoal velvet with slate marble (VelvetMarble).
- Fill [AppColors] AccentStrong / AccentSoft per theme so the home-tab button gradient matches instead of falling back to the default greens.
- Derive Disabled and Inactive groups with the same conventions as PaletteGenerator::fromAccent.
* [Themes] Add home backgrounds for the image themes
* [Themes] Ship Fusion style + scheme backgrounds for the image themes
Address PR review:
- Add theme.cfg ([Style] Name = Fusion, ColorScheme = System) to Fabric,
Leather, Plasma and VelvetMarble so their curated palettes actually apply.
Without it the native style paints button chrome from the OS (windowsvista
on Windows has no dark mode), making the dark palettes' light ButtonText
unreadable on light buttons.
- Leverage the scheme-variant asset resolution: register home-dark.png and
home-light.png in resources and add them to the qrc so the built-in home
background also flips with the palette instead of staying static.
- Fix Leather [Palette.Inactive] Accent, which copied the Active Highlight
color instead of the theme accent (dark #4a5f8f -> #c9995a, light
#34508c -> #a5712f) in both palette files.
* [Themes] Align light plasma home background with the dark variant
Recolored the Plasma light home background to mirror the dark one:
brighter violet/cyan blooms, vivid azure spark arcs, and higher accent
saturation against the same pale-lavender key. Brightness is unchanged
so it still reads as a light scheme.
* [Home] Add option to disable the home tab background dim
Adds a 'Dim the home tab background' checkbox to the Home tab settings
page (Appearance). When unchecked, HomeWidget skips the translucent
black overlay it paints over the whole background. Default is on,
preserving current behavior; the home tab repaints live on change.
* Update leather backgrounds
* Update velvet marble backgrounds
* Update light plasma background
* Update light fabric background
* WIP [UI] Theme-aware onboarding banner with frosted light mode
Banner colours now derive from palette tokens at ~60fps (tick-driven,
equality-guarded setters) so scheme switches and live accent-picker
previews apply instantly:
- dark stages: byte-for-byte the original treatment (near-black stage
from window hue, Highlight accent, white centre halo, vignette 0.62)
- light stages: pastel accent-hue wash instead of a neutral grey copy,
brightness-lifted accent for additive glow legibility, deep-Highlight
halo (uGlowColor) instead of white blowout, gentler vignette
(uVignetteMin 0.88) so corners don't go muddy
- black logo silhouette variant selected on light stages
- theme picker preseeded with brand green (brand_colors.h single source)
WIP notes for next session:
- real-pixel wizard screenshot check still pending (headless capture
exists: Xvfb :77 + isolated XDG_DATA_HOME; shader vs fallback pixel
analysis not finished)
- user plans separately: promote Fusion to default theme, Default -> system
* [Themes] Align Fusion accent tokens with the SVG brand gradient
Align AccentStrong (#139740) and AccentSoft (#c9fd62) and the linked
Link/Accent roles with cockatrice.svg's linearGradient4265-7-8 stops so the
identity gradient used by the logo emulation matches the static art the icon
shipped.
* [Onboarding] Draw the banner logo as a static gradient plate
Replace the black/white logo tint switch with a ShaderEffect plate that
repaints the SVG's brand gradient (light AccentSoft -> dark AccentStrong
along the baked-in userSpaceOnUse axis) clipped to the full-color logo's
alpha silhouette, with the white highlight path overlaid on top — matching
the home widget's QPainter composite. The plate is static: no glow or
breathing. Brand colors flow from BannerShaderConfig's new brandStrong/
brandSoft pair instead of the removed logoDark flag, and the background
motifs get a touch more accent so the mark keeps its coloured surround.
* [Home] Draw the featured logo as a theme gradient composite
Repaint cockatrice.svg in Qt instead of showing the baked-in static art:
fill the full-color logo's alpha silhouette with the same brand gradient the
banner plate uses (light AccentSoft grading to dark AccentStrong along the
SVG's userSpaceOnUse axis), then overlay the white highlight path. Renders
an explicit QPixmap so the mark stays crisp at the 200px display size, and
re-seeds it on theme/palette/appearance changes so it never goes stale.
* [Resources] Drop the unused black logo asset
No consumer remains after the banner's logoDark toggle was replaced by the
static gradient plate (unit-tested in d7529e0c6a), so remove
cockatrice-logo-black.svg and its qrc entry.
* [Onboarding] Seed the theme picker from the theme's identity accent
Replace the hardcoded brand-green preseed with the shipped theme's own
AccentStrong (Plasma seeds violet, Fusion green), resolved from the default
palette so auto/user-generated palettes can't mask it, and re-seed whenever
the theme changes so the swatch never goes stale. Also consult the shipped
palette in maybeAutoGeneratePalette so scheme flips don't regenerate a fresh
palette over curated theme colors.
* Regenerate zone assets for Fabric, Leather, VelvetMarble themes
Align zone textures with each theme's palette identity:
- Fabric: linen weave in navy/steel tones (was generic green/blue/red/gray)
- Leather: grain texture in warm brown/amber tones
- VelvetMarble: smooth charcoal marble veining (replaces .jpg with .png)
All zones now have dark + light scheme variants for OS color scheme
adaptation. Plasma zones deferred to separate iteration.
* Regenerate Plasma zone assets: horizontal-hand layout, seamless tiling
Bake each zone's phase from its true world position in the horizontal-hand
layout (player 0, stack 172, table 280, hand 172+406) so the diagonal sheen
continues continuously across zone boundaries. All zones share one
mathematically tileable (1,1) diagonal at frequency 3; playerzone gets a
distinct blue-violet identity and the light scheme gets extra contrast.
* Regenerate VelvetMarble zones: classic Perlin marble, seamless tiling
* Regenerate VelvetMarble zones: domain-warped fractal veins, stone grain
* Promote Fusion to default theme, rename Default to System
Fresh installs and new profiles now default to the Fusion (dark) theme
instead of the platform-native theme. The old "Default" theme is
renamed "System" to better describe its purpose — using the OS-native
Qt style (windowsvista, macOS, etc.).
Existing users who had "Default" selected are automatically migrated
to "System" so they keep their platform-native styling. Users with
an empty or invalid theme name now fall back to Fusion.
* Move checkbox.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
313 lines
7.4 KiB
C++
313 lines
7.4 KiB
C++
#ifndef BANNER_SHADER_CONFIG_H
|
|
#define BANNER_SHADER_CONFIG_H
|
|
|
|
#include <QColor>
|
|
#include <QObject>
|
|
|
|
/**
|
|
* Uniform values fed to brand_banner.frag, exposed to QML as the
|
|
* "bannerConfig" context property.
|
|
*
|
|
* Two independent "banks" (A/B) each carry their own mode/speed/seed so
|
|
* BrandBanner.qml can render both simultaneously and crossfade between
|
|
* them via opacity -- see frontIsA. The shared palette (colorA/colorB/
|
|
* accent) and clock (time/aspect) apply to both banks identically, since
|
|
* only the foreground motif changes between onboarding pages, never the
|
|
* brand palette.
|
|
*
|
|
* Deliberately plain `property` (not `required property`) on the QML side
|
|
* -- a required-property shadowing bug bit the home-screen particle
|
|
* background before, and there's no reason to reintroduce that risk here.
|
|
*/
|
|
class BannerShaderConfig : public QObject
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(qreal time READ time WRITE setTime NOTIFY timeChanged)
|
|
Q_PROPERTY(qreal aspect READ aspect WRITE setAspect NOTIFY aspectChanged)
|
|
|
|
Q_PROPERTY(qreal modeA READ modeA WRITE setModeA NOTIFY modeAChanged)
|
|
Q_PROPERTY(qreal speedA READ speedA WRITE setSpeedA NOTIFY speedAChanged)
|
|
Q_PROPERTY(qreal seedA READ seedA WRITE setSeedA NOTIFY seedAChanged)
|
|
|
|
Q_PROPERTY(qreal modeB READ modeB WRITE setModeB NOTIFY modeBChanged)
|
|
Q_PROPERTY(qreal speedB READ speedB WRITE setSpeedB NOTIFY speedBChanged)
|
|
Q_PROPERTY(qreal seedB READ seedB WRITE setSeedB NOTIFY seedBChanged)
|
|
|
|
Q_PROPERTY(bool frontIsA READ frontIsA WRITE setFrontIsA NOTIFY frontIsAChanged)
|
|
|
|
Q_PROPERTY(QColor colorA READ colorA WRITE setColorA NOTIFY colorAChanged)
|
|
Q_PROPERTY(QColor colorB READ colorB WRITE setColorB NOTIFY colorBChanged)
|
|
Q_PROPERTY(QColor accent READ accent WRITE setAccent NOTIFY accentChanged)
|
|
Q_PROPERTY(QColor glowColor READ glowColor WRITE setGlowColor NOTIFY glowColorChanged)
|
|
Q_PROPERTY(QColor brandStrong READ brandStrong WRITE setBrandStrong NOTIFY brandStrongChanged)
|
|
Q_PROPERTY(QColor brandSoft READ brandSoft WRITE setBrandSoft NOTIFY brandSoftChanged)
|
|
Q_PROPERTY(qreal vignetteMin READ vignetteMin WRITE setVignetteMin NOTIFY vignetteMinChanged)
|
|
|
|
Q_PROPERTY(bool logoVisible READ logoVisible WRITE setLogoVisible NOTIFY logoVisibleChanged)
|
|
Q_PROPERTY(qreal logoGlow READ logoGlow WRITE setLogoGlow NOTIFY logoGlowChanged)
|
|
|
|
public:
|
|
explicit BannerShaderConfig(QObject *parent = nullptr) : QObject(parent)
|
|
{
|
|
}
|
|
|
|
qreal time() const
|
|
{
|
|
return m_time;
|
|
}
|
|
void setTime(qreal v)
|
|
{
|
|
if (v != m_time) {
|
|
m_time = v;
|
|
emit timeChanged();
|
|
}
|
|
}
|
|
|
|
qreal aspect() const
|
|
{
|
|
return m_aspect;
|
|
}
|
|
void setAspect(qreal v)
|
|
{
|
|
if (v != m_aspect) {
|
|
m_aspect = v;
|
|
emit aspectChanged();
|
|
}
|
|
}
|
|
|
|
qreal modeA() const
|
|
{
|
|
return m_modeA;
|
|
}
|
|
void setModeA(qreal v)
|
|
{
|
|
if (v != m_modeA) {
|
|
m_modeA = v;
|
|
emit modeAChanged();
|
|
}
|
|
}
|
|
qreal speedA() const
|
|
{
|
|
return m_speedA;
|
|
}
|
|
void setSpeedA(qreal v)
|
|
{
|
|
if (v != m_speedA) {
|
|
m_speedA = v;
|
|
emit speedAChanged();
|
|
}
|
|
}
|
|
qreal seedA() const
|
|
{
|
|
return m_seedA;
|
|
}
|
|
void setSeedA(qreal v)
|
|
{
|
|
if (v != m_seedA) {
|
|
m_seedA = v;
|
|
emit seedAChanged();
|
|
}
|
|
}
|
|
|
|
qreal modeB() const
|
|
{
|
|
return m_modeB;
|
|
}
|
|
void setModeB(qreal v)
|
|
{
|
|
if (v != m_modeB) {
|
|
m_modeB = v;
|
|
emit modeBChanged();
|
|
}
|
|
}
|
|
qreal speedB() const
|
|
{
|
|
return m_speedB;
|
|
}
|
|
void setSpeedB(qreal v)
|
|
{
|
|
if (v != m_speedB) {
|
|
m_speedB = v;
|
|
emit speedBChanged();
|
|
}
|
|
}
|
|
qreal seedB() const
|
|
{
|
|
return m_seedB;
|
|
}
|
|
void setSeedB(qreal v)
|
|
{
|
|
if (v != m_seedB) {
|
|
m_seedB = v;
|
|
emit seedBChanged();
|
|
}
|
|
}
|
|
|
|
bool frontIsA() const
|
|
{
|
|
return m_frontIsA;
|
|
}
|
|
void setFrontIsA(bool v)
|
|
{
|
|
if (v != m_frontIsA) {
|
|
m_frontIsA = v;
|
|
emit frontIsAChanged();
|
|
}
|
|
}
|
|
|
|
QColor colorA() const
|
|
{
|
|
return m_colorA;
|
|
}
|
|
void setColorA(const QColor &c)
|
|
{
|
|
if (c != m_colorA) {
|
|
m_colorA = c;
|
|
emit colorAChanged();
|
|
}
|
|
}
|
|
QColor colorB() const
|
|
{
|
|
return m_colorB;
|
|
}
|
|
void setColorB(const QColor &c)
|
|
{
|
|
if (c != m_colorB) {
|
|
m_colorB = c;
|
|
emit colorBChanged();
|
|
}
|
|
}
|
|
QColor accent() const
|
|
{
|
|
return m_accent;
|
|
}
|
|
void setAccent(const QColor &c)
|
|
{
|
|
if (c != m_accent) {
|
|
m_accent = c;
|
|
emit accentChanged();
|
|
}
|
|
}
|
|
|
|
QColor glowColor() const
|
|
{
|
|
return m_glowColor;
|
|
}
|
|
void setGlowColor(const QColor &c)
|
|
{
|
|
if (c != m_glowColor) {
|
|
m_glowColor = c;
|
|
emit glowColorChanged();
|
|
}
|
|
}
|
|
|
|
QColor brandStrong() const
|
|
{
|
|
return m_brandStrong;
|
|
}
|
|
void setBrandStrong(const QColor &c)
|
|
{
|
|
if (c != m_brandStrong) {
|
|
m_brandStrong = c;
|
|
emit brandStrongChanged();
|
|
}
|
|
}
|
|
|
|
QColor brandSoft() const
|
|
{
|
|
return m_brandSoft;
|
|
}
|
|
void setBrandSoft(const QColor &c)
|
|
{
|
|
if (c != m_brandSoft) {
|
|
m_brandSoft = c;
|
|
emit brandSoftChanged();
|
|
}
|
|
}
|
|
|
|
qreal vignetteMin() const
|
|
{
|
|
return m_vignetteMin;
|
|
}
|
|
void setVignetteMin(qreal v)
|
|
{
|
|
if (v != m_vignetteMin) {
|
|
m_vignetteMin = v;
|
|
emit vignetteMinChanged();
|
|
}
|
|
}
|
|
|
|
bool logoVisible() const
|
|
{
|
|
return m_logoVisible;
|
|
}
|
|
void setLogoVisible(bool v)
|
|
{
|
|
if (v != m_logoVisible) {
|
|
m_logoVisible = v;
|
|
emit logoVisibleChanged();
|
|
}
|
|
}
|
|
|
|
qreal logoGlow() const
|
|
{
|
|
return m_logoGlow;
|
|
}
|
|
void setLogoGlow(qreal v)
|
|
{
|
|
if (v != m_logoGlow) {
|
|
m_logoGlow = v;
|
|
emit logoGlowChanged();
|
|
}
|
|
}
|
|
|
|
signals:
|
|
void timeChanged();
|
|
void aspectChanged();
|
|
void modeAChanged();
|
|
void speedAChanged();
|
|
void seedAChanged();
|
|
void modeBChanged();
|
|
void speedBChanged();
|
|
void seedBChanged();
|
|
void frontIsAChanged();
|
|
void colorAChanged();
|
|
void colorBChanged();
|
|
void accentChanged();
|
|
void glowColorChanged();
|
|
void brandStrongChanged();
|
|
void brandSoftChanged();
|
|
void vignetteMinChanged();
|
|
void logoVisibleChanged();
|
|
void logoGlowChanged();
|
|
|
|
private:
|
|
qreal m_time = 0.0;
|
|
qreal m_aspect = 16.0 / 9.0;
|
|
|
|
qreal m_modeA = 0.0;
|
|
qreal m_speedA = 1.0;
|
|
qreal m_seedA = 0.0;
|
|
|
|
qreal m_modeB = 0.0;
|
|
qreal m_speedB = 1.0;
|
|
qreal m_seedB = 0.0;
|
|
|
|
bool m_frontIsA = true;
|
|
|
|
// Curated fallback seed values -- BannerHost overwrites these with
|
|
// palette-derived colours (see shader_banner_widget.cpp) before the first
|
|
// paint, so they only matter as a safe pre-first-apply default.
|
|
QColor m_colorA{0x1A, 0x1A, 0x20};
|
|
QColor m_colorB{0x0E, 0x0E, 0x12};
|
|
QColor m_accent{0x8B, 0xDD, 0x6B};
|
|
QColor m_glowColor{Qt::white};
|
|
QColor m_brandStrong{0x13, 0x97, 0x40};
|
|
QColor m_brandSoft{0xC9, 0xFD, 0x62};
|
|
qreal m_vignetteMin = 0.62;
|
|
|
|
bool m_logoVisible = false;
|
|
qreal m_logoGlow = 1.0;
|
|
};
|
|
|
|
#endif // BANNER_SHADER_CONFIG_H
|