fix(qt): glyph colours follow the theme, on light palettes and on accent fills

Two defects with one cause: a tint name that means a frozen hex.

"primary" is the legacy alias of literal #ffffff, not Theme.text-primary,
so every control passing it drew a white glyph. On the eleven light
themes that is white-on-light -- the header back/forward chevrons, the
sidebar toggle and the carousel arrows the owner marked. They now pass
the theme-following names, which icon_tint_qt bakes at runtime.

The stale `hslLightness > 0.5 ? "primary" : "black"` workarounds that
predate the runtime tinter collapse into those names, and the qrc floor
underneath them becomes polarity-aware: dir_for() returns "" whenever
the cache dir is unavailable, a bake fails or the theme document has not
been published, and that path used to resolve textPrimary straight back
to the white bake -- reproducing the bug it was fixing, app-wide, in the
degraded state.

On accent fills the fix is a deviation from Slint, approved by the owner
after measurement. A fixed white glyph on Theme.accent falls under 2.6:1
on 16 of the 35 shipped palettes, including high-contrast at 1.70:1 and
wcag-dark at 1.82:1 -- the two themes whose reason to exist is contrast.
Slint hardcodes #ffffff there (CircleAction.slint:72 and three others),
so the bug is upstream. accentText alone is not the answer either: it is
picked for the theme's text ramp and gives 2.56:1 on Rose Pine Dawn,
worse than the black it replaces. So QbzTheme picks the best-contrast
tint by real sRGB luminance against the live accent, and the labels
beside those glyphs use its colour twin -- BrowseGenreButton and
LibraryView were drawing a white glyph next to an accentText label
inside the same pill.

Rounds out the two parity items the same files owe: QbzNavButton gains
the ambient arm from Carousel.slint (wired at the six carousel sites,
not left dead), and QbzCircleAction rounds its glyph to whole pixels the
way CircleAction.slint does.

cc
This commit is contained in:
vicrodh committed 2026-07-29 10:30:43 -06:00
1 parent 8af04c5272
commit 81c43a114e
52 files changed
+841 -153

No files matched your search

@@ -55,7 +55,17 @@ Rectangle {
width: 14
height: 14
anchors.verticalCenter: parent.verticalCenter
tintName: root.active ? "primary" : "secondary"
// Both halves of this pill take the SAME decision now. They did
// not before: the glyph said "primary" (the legacy alias of a
// literal #ffffff) while the label below said accent-text, so on
// every pale-accent theme the pill drew a black label next to a
// white glyph. discover/BrowseHeaderTools.slint:123 and :132 are
// at least self-consistent — they are BOTH #ffffff — but that
// white measures 1.70:1 on high-contrast, 1.74 on ikari and
// 1.82 on wcag-dark, under 2.6:1 on 16 of the 35 palettes, so
// the port diverges from both lines at once, by measurement.
// See theme/QbzTheme.qml, "ON AN ACCENT FILL".
tintName: root.active ? theme.accentGlyphTint : "secondary"
}
Text {
text: root.count === 0
@@ -63,7 +73,10 @@ Rectangle {
: root.count === 1
? QbzSession.tr("1 genre", QbzSession.trRev)
: QbzSession.tr("{} genres", QbzSession.trRev).replace("{}", root.count)
color: root.active ? theme.accentText : theme.textSecondary
// The colour twin of the glyph's tint (see above) — accent-text
// on 34 of the 35 palettes, so this is a no-op everywhere except
// where accent-text itself falls under 3:1.
color: root.active ? theme.accentGlyphColor : theme.textSecondary
font.pixelSize: 13
font.weight: root.active ? theme.weightMedium : theme.weightRegular
anchors.verticalCenter: parent.verticalCenter
+4 -1
View File
@@ -73,7 +73,10 @@ QbzContextMenu {
width: 15
height: 15
anchors.verticalCenter: parent.verticalCenter
tintName: row.hot ? "primary" : "secondary"
// Host is `surfaceHover`/transparent over a theme surface,
// so the glyph tracks the sibling label (textPrimary/
// textSecondary below) rather than a fixed white.
tintName: row.hot ? "textPrimary" : "secondary"
}
Text {
height: parent.height
@@ -30,7 +30,11 @@ Rectangle {
width: primary ? 18 : 16
height: primary ? 18 : 16
anchors.centerIn: parent
tintName: parent.active ? "accent" : (parent.primary ? "black" : "primary")
// Both non-accent arms are theme-INDEPENDENT by design: this button
// only ever sits on artwork. `primary` is a solid #ffffff disc (black
// glyph), the ghost arm is #24ffffff over the artwork itself (white
// glyph). "white" is the explicit spelling of what "primary" baked.
tintName: parent.active ? "accent" : (parent.primary ? "black" : "white")
}
property alias hovered: obArea.containsMouse
MouseArea {
@@ -115,7 +115,7 @@ Item {
name: "x"
width: 17
height: 17
tintName: cfgCloseArea.containsMouse ? "primary" : "muted"
tintName: cfgCloseArea.containsMouse ? "textPrimary" : "muted"
}
MouseArea {
id: cfgCloseArea
@@ -156,7 +156,7 @@ Item {
name: "x"
width: 15
height: 15
tintName: closeArea.containsMouse ? "primary" : "muted"
tintName: closeArea.containsMouse ? "textPrimary" : "muted"
}
MouseArea {
id: closeArea
@@ -341,7 +341,15 @@ Item {
name: "check"
width: 11
height: 11
tintName: "primary"
// DELIBERATE DIVERGENCE from
// discover/GenreFilterPopup.slint:85,
// which hardcodes `tint: #ffffff`
// on this accent box — 1.70:1 on
// high-contrast, 1.74 on ikari,
// 16 of the 35 palettes under
// 2.6:1. theme/QbzTheme.qml, "ON
// AN ACCENT FILL".
tintName: theme.accentGlyphTint
}
}
@@ -410,7 +418,16 @@ Item {
width: parent.width - 24
height: parent.height
text: chip.modelData.name
color: chip.modelData.selected ? theme.accentText : theme.textSecondary
// On the accent fill -> the measured on-accent
// colour. GenreFilterPopup.slint:125 hardcodes
// #ffffff (same defect as :85 above); the port
// had already moved to accent-text, and
// `accentGlyphColor` IS accent-text on 34 of
// the 35 palettes — it only differs where
// accent-text itself drops under 3:1
// (rose-pine-dawn, 2.56:1).
color: chip.modelData.selected
? theme.accentGlyphColor : theme.textSecondary
font.pixelSize: 13
font.weight: chip.modelData.selected ? theme.weightMedium : theme.weightRegular
verticalAlignment: Text.AlignVCenter
@@ -421,7 +438,21 @@ Item {
width: 16
height: 16
radius: 8
color: chip.modelData.selected ? theme.accentText : "transparent"
// INVERTED host: this 16px disc is the chip's
// FOREGROUND punched out of the accent fill,
// and the check inside it is tinted `accent`.
// So the pair that has to clear the floor is
// (accent glyph, this fill) — the same two
// colours as everywhere else on this pill,
// just swapped. Painting it with
// `accentGlyphColor` rather than raw
// accent-text is what keeps that true:
// identical on 34 palettes, and on
// rose-pine-dawn it turns a 2.56:1 check into
// 7.38:1. GenreFilterPopup.slint:141 paints
// this disc #ffffff.
color: chip.modelData.selected
? theme.accentGlyphColor : "transparent"
border.width: chip.modelData.selected ? 0 : 2
border.color: theme.borderMuted
QbzIcon {
+13 -2
View File
@@ -1,5 +1,5 @@
// QbzCheckbox (primitives/QbzCheckbox.slint) — 18px square, r4, accent fill
// with a black check when on, 1.5px muted border when off. Emits toggled();
// with an accent-text check when on, muted border when off. Emits toggled();
// like the Slint original it never self-flips (the owner of the state does).
//
// Used by Settings > Local Library (folder selection) and the Plex library
@@ -27,7 +27,18 @@ Rectangle {
anchors.centerIn: parent
visible: root.checked
name: "check"
tintName: "black"
// The glyph sits ON the accent fill. primitives/QbzCheckbox.slint:24
// says `tint: Theme.accent-text` and this was 1:1 with it; it now
// goes through the selector, which RETURNS accent-text on 34 of the
// 35 palettes — so this is not a divergence from :24 so much as a
// floor under it. The one row it changes is rose-pine-dawn, where
// accent-text #575279 on accent #d7827e is 2.56:1, under the 3:1
// non-text floor, and the selector hands back black at 7.38:1.
// Routing every on-accent glyph through one property is also what
// stops this control and views/local/SelectCheck.qml from drifting
// apart again — upstream contradicts itself between the two
// (SelectionCheckbox.slint:37 hardcodes #ffffff for the same job).
tintName: theme.accentGlyphTint
width: 12
height: 12
}
+59 -21
View File
@@ -29,17 +29,32 @@
// `Theme.text-primary` (CircleAction.slint:73) — the theme's max-contrast
// colour, DARK on a light theme.
//
// The port could not express that, and this is where it was still broken:
// icon tints here are PRE-BAKED SVG variants (QbzIcon.qml), and the
// "primary" bake is a hardcoded `fill="#ffffff"` — it is NOT text-primary,
// it is white. So the on-surface secondary (a `surface-elevated` disc, i.e.
// near-white on a light theme) was painting a WHITE glyph on it: the exact
// vanishing act the .slint arm was written to stop. `onSurfaceTint` below
// resolves text-primary to the only baked dark variant ("black") whenever
// the active theme is light — theme.isDark is Rust-published from the
// surface-main luminance (theme_qt.rs:221), the same luminance test Slint's
// `Theme.is-dark` uses. The OVERLAY arm keeps its literals: it sits on the
// artwork band, which is dark under every theme.
// The port could not express that at first: icon tints were PRE-BAKED SVG
// variants only, and the "primary" bake is a hardcoded `fill="#ffffff"` — it
// is NOT text-primary, it is white. So the on-surface secondary (a
// `surface-elevated` disc, i.e. near-white on a light theme) painted a WHITE
// glyph on it: the exact vanishing act the .slint arm was written to stop.
// The stopgap was `onSurfaceTint = theme.isDark ? "primary" : "black"`, a
// 2-value approximation of text-primary.
//
// It is no longer needed. QbzIcon resolves theme-following tints through
// src/icon_tint_qt.rs, which bakes the live theme's ACTUAL text-primary hex,
// so this arm now says "textPrimary" and is exact under all 36 themes.
//
// The OVERLAY arm keeps its literals: it sits on hosts that are
// theme-independent — the artwork band, the solid white disc — and Slint
// hardcodes them for the same reason (CircleAction.slint:70-74, `#ffffff` /
// `#000000` literals next to `Theme.text-primary`). It spells them
// "white"/"black" now, not "primary", so no one re-reads the legacy alias as
// the theme token.
//
// The on-surface PRIMARY glyph USED to be in that group and is not any more.
// Its host is NOT theme-independent — it is `theme.accent` — and the fixed
// #ffffff CircleAction.slint:72 puts on it is unreadable on 16 of the 35
// shipped palettes (worst: high-contrast 1.70:1, then ikari 1.74, wcag-dark
// 1.82). It now takes `theme.accentGlyphTint`, the measured
// on-accent selector; see the note at the tint binding and the long rationale
// in theme/QbzTheme.qml.
import QtQuick
import com.blitzfc.qbz
@@ -58,10 +73,9 @@ Rectangle {
QbzTheme { id: theme }
/// Slint's `Theme.text-primary` glyph tint, expressed in baked variants:
/// the "primary" bake is a literal #ffffff, so a light theme has to take
/// the "black" bake or the glyph paints white-on-near-white.
readonly property string onSurfaceTint: theme.isDark ? "primary" : "black"
/// Slint's `Theme.text-primary` glyph tint (CircleAction.slint:73),
/// runtime-tinted so it is the real token under every theme.
readonly property string onSurfaceTint: "textPrimary"
width: primary ? 44 : 32
height: primary ? 44 : 32
@@ -80,19 +94,43 @@ Rectangle {
name: root.name
width: root.primary ? 19 : 15
height: root.primary ? 19 : 15
anchors.centerIn: parent
// CircleAction.slint:70-74, verbatim:
// Whole-pixel centring, both axes — CircleAction.slint:67-68 rounds
// them explicitly for the same reason: 44-19 and 32-15 are both ODD,
// so `anchors.centerIn` lands the glyph on 12.5px / 8.5px and the
// software renderer resamples it soft, right next to the now
// pixel-crisp 28px QbzNavButton chevrons.
x: Math.round((parent.width - width) / 2)
y: Math.round((parent.height - height) / 2)
// CircleAction.slint:70-74:
// active -> Theme.accent
// on-surface + primary -> #ffffff (glyph on the accent disc)
// on-surface + primary -> #ffffff <- DELIBERATE DIVERGENCE, see
// below; this port uses the measured
// on-accent selector instead
// on-surface + secondary -> Theme.text-primary <- the light-theme
// case; "primary" would be white here
// case; a fixed white would vanish here
// overlay + primary -> #000000 (glyph on the white disc)
// overlay + secondary -> #ffffff
//
// The ONE divergence is the on-surface PRIMARY glyph. Its host is the
// 44px `theme.accent` disc (`color:` above, accentHover on hover —
// which is why the selector folds both fills in) and CircleAction.slint:72
// hardcodes #ffffff on it — which measures 1.70:1 on high-contrast,
// 1.74 on ikari, 1.82 on wcag-dark, 1.85 on kurosaki and so on for
// 16 of the 35 shipped palettes (the two accessibility themes lead
// that list, which is the strongest part of the argument).
// `theme.accentGlyphTint` is that decision made against the
// live accent (QbzTheme.qml, "ON AN ACCENT FILL"); it still resolves
// to a white glyph on Dark / Light / OLED, so the default themes'
// play button is unchanged.
//
// The OVERLAY arm keeps its literals: those hosts (the solid white
// disc, the artwork band) are theme-independent, so there is nothing
// to measure against and nothing to diverge from.
tintName: root.active
? "accent"
: (root.overlay
? (root.primary ? "black" : "primary")
: (root.primary ? "primary" : root.onSurfaceTint))
? (root.primary ? "black" : "white")
: (root.primary ? theme.accentGlyphTint : root.onSurfaceTint))
}
MouseArea {
id: cbArea
+17 -16
View File
@@ -6,16 +6,19 @@
// `active` (accent glyph), `activeBackground` (HeaderBar: elevated fill
// when active), `btnEnabled` (dims 0.3 + muted glyph, disarms).
//
// LIGHT-THEME CORRECTNESS: the glyph tints are PRE-BAKED SVG colours
// (assets/icons/<tint>/) — "primary" is literally #ffffff and "secondary"
// #cccccc, i.e. the DARK theme's text-primary / text-secondary frozen into
// the asset. On a light theme those render near-white on a light surface and
// the whole button set disappears, which is the reported bug. The bake is
// therefore chosen from the LIVE token's lightness instead of being
// hardcoded: bright token -> the light bake, dark token -> the dark bake.
// TODO(glue): the durable home for this is a QbzTheme.tintFor(token) helper
// (or real runtime tinting in QbzIcon) — see the report; it is duplicated in
// FavToggle / TransportControls / SongCard until then.
// LIGHT-THEME CORRECTNESS: this button's fills are THEME surfaces
// (surface-hover / surface-elevated / transparent), so its glyphs must be
// theme tokens, never fixed colours.
//
// This used to pick between two FIXED bakes by reading the live token's
// lightness (`textPrimary.hslLightness > 0.5 ? "primary" : "black"`) — a
// 2-value approximation of a token, from the era when assets/icons/<tint>/
// was all there was and "primary" was literally #ffffff. That era is over:
// QbzIcon now resolves theme-following tints through src/icon_tint_qt.rs,
// which bakes the REAL hex of the live theme's token, so "textPrimary" and
// "secondary" are exact under all 36 themes and the ternary is dead weight.
// The old TODO asking for a QbzTheme.tintFor(token) helper is closed by the
// same change — there is nothing left to hoist.
import QtQuick
import com.blitzfc.qbz
@@ -33,12 +36,10 @@ Rectangle {
QbzTheme { id: theme }
// Bake that actually matches Theme.text-primary / text-secondary in the
// ACTIVE theme (BarControls.slint IconButton: hover -> text-primary,
// idle -> text-secondary). text-muted maps to the "muted" bake in both
// polarities: #888888 is mid-grey and reads on light and dark alike.
readonly property string tintStrong: theme.textPrimary.hslLightness > 0.5 ? "primary" : "black"
readonly property string tintWeak: theme.textSecondary.hslLightness > 0.5 ? "secondary" : "muted"
// BarControls.slint IconButton: hover -> text-primary, idle ->
// text-secondary. Both are runtime-tinted, so they ARE those tokens.
readonly property string tintStrong: "textPrimary"
readonly property string tintWeak: "secondary"
width: btnSize
height: btnSize
+2 -2
View File
@@ -91,7 +91,7 @@ Rectangle {
width: root.sm ? 14 : 16
height: root.sm ? 14 : 16
anchors.centerIn: parent
tintName: openArea.containsMouse ? "primary" : "muted"
tintName: openArea.containsMouse ? "textPrimary" : "muted"
}
MouseArea {
id: openArea
@@ -199,7 +199,7 @@ Rectangle {
width: 12
height: 12
anchors.centerIn: parent
tintName: clearArea.containsMouse ? "primary" : "muted"
tintName: clearArea.containsMouse ? "textPrimary" : "muted"
}
MouseArea {
id: clearArea
+101 -3
View File
@@ -2,6 +2,82 @@
// consolidated in phase 22 from THREE identical copies (HomeView.NavBtn,
// SectionRail.RailNavBtn, HeaderBar.HeaderNavBtn). Contract: icon `name`,
// `btnEnabled` (dims to 0.4 + muted glyph, disarms), `clicked()`.
//
// Geometry and states are 1:1 with BOTH Slint originals: 28x28, r14,
// surface-elevated idle / surface-hover on hover, opacity 0.4 disabled, glyph
// 15x15 at a WHOLE-PIXEL offset (28-15 = 13 -> centerIn would land on 6.5px
// and render blurry; Slint rounds deliberately, HeaderBar.slint:329-330).
//
// The IDLE FILL is where the two originals part company, and the difference
// is not cosmetic drift:
// - HeaderNavBtn (shell/HeaderBar.slint:312-342) has two arms, hover and
// idle. Its host — the header chrome bar — is ALREADY the translucent
// surface under the ambient background (HeaderBar.qml: surfaceCardA50),
// so the disc stays opaque and reads as a solid control on frosted
// chrome.
// - The six carousel NavButtons (discover/Carousel.slint:15-45, and the
// byte-identical copies in ArtistCarousel / PlaylistCarousel /
// RadioCarousel / SlimCarousel / PinnedCarousel) have a THIRD arm: with
// `ShellState.app-background-active` they idle at
// `Theme.surface-elevated.with-alpha(AppearanceState
// .app-background-surface-alpha)`, so the artwork wash reads THROUGH the
// chevrons instead of leaving opaque discs pasted on it. They sit on the
// frosted content panel, not on chrome.
// This file carries that arm behind `ambient` (see below), defaulting OFF —
// which is the header's behaviour, i.e. the shared default is the SAFE one.
//
// WHERE THIS COMPONENT IS MOUNTED — all of it, because the previous version
// of this header named only the two carousel sites and read as if they were
// the whole story. Seven files, thirteen instances, and the ambient decision
// is per HOST SURFACE, not per file:
//
// CONTENT PANEL (translucent under the wash) — arm ON:
// controls/QbzSectionHeader.qml:76,82 the carousel page chevrons.
// WIRED. Those two are the six Slint carousel navigators (that header
// is a POC consolidation of Home / SectionRail / Search / Label
// carousel headers, and upstream all four import the carousel
// components), so `ambient: true` there is 1:1, not a deviation.
//
// CHROME (opaque control on the frosted chrome bar) — arm OFF:
// shell/HeaderBar.qml:230,235,241 panel-left + back + forward.
// Host is HeaderBar's own root, `ambientOn ? surfaceCardA50 :
// surfaceCard` (HeaderBar.qml:40) — the bar is what goes translucent,
// the discs on it stay solid. Exactly HeaderNavBtn.
//
// CONTENT PANEL BY HOST, ARM DELIBERATELY OFF — upstream contradicts
// itself and the divergence is not this round's to take:
// views/local/LocalChrome.qml:43,53 settings gear + Plex re-sync
// views/local/LocalToolbar.qml:187,201 the two square-check-big
// multi-select toggles
// All four render inside AppShell's contentFrame, which IS the frosted
// panel (AppShell.qml:149, surface-main @0.22 + hairline), and their
// Slint root goes fully transparent under the wash
// (locallibrary/LocalLibraryView.slint:705) so that panel shows
// through. By host surface these are content panel, same as the
// carousels. But their upstream counterpart is `CircleIconBtn`
// (LocalLibraryView.slint:313-321, used at :731 :742 :915 :931) and it
// has only TWO arms — `ta.has-hover ? surface-hover : surface-elevated`
// — i.e. Slint leaves opaque discs on its own translucent panel here
// while giving the carousels the third arm on the same kind of
// surface. Wiring these four is a one-word edit and probably the
// correct look; it is also an unapproved app-wide visual divergence,
// so it stops here with the measurement attached. Owner: `ambient:
// true` on those four lines is the whole change.
// views/LocalAlbumView.qml:164,169 the in-page back/forward pair.
// Content panel by host, and there is NO upstream to be 1:1 with:
// album/LocalAlbumView.slint:205-208 puts `NavButtons { }` there, and
// shell/NavButtons.slint is a zero-size placeholder since the real
// back/forward moved into the header. Slint draws nothing at all at
// this spot. Left OFF to match the identical HeaderBar pair it
// duplicates rather than the carousels it sits beside — flag, not
// conclusion.
//
// The glyph tint is `text-primary` / `text-muted`, NOT a fixed colour: the
// disc is a THEME surface, so on the 11 light themes a literal #ffffff glyph
// is 1.13-1.38:1 against it (APCA Lc 0.0-12.3 — no contrast at all). That was
// the owner-reported bug: this file asked for "primary", which in this port is
// the LEGACY ALIAS OF LITERAL WHITE and not Theme.text-primary (see
// theme/QbzIcon.qml and src/icon_tint_qt.rs `token_for`).
import QtQuick
import com.blitzfc.qbz
@@ -10,21 +86,43 @@ import "../theme"
Rectangle {
property string name: ""
property bool btnEnabled: true
/// Carousel arm (Carousel.slint:25-27): let the ambient wash through the
/// idle disc. OFF by default because the header must NOT do this.
property bool ambient: false
signal clicked()
QbzTheme { id: theme }
// `ShellState.app-background-active` (state.slint:4184) — the port spells
// it this way app-wide, npHasTrack included: with nothing playing the
// shell restores its opaque theme surfaces (rule D4).
readonly property bool ambientOn:
ambient && QbzShell.ambientMode > 0 && QbzPlayer.npHasTrack
width: 28
height: 28
radius: 14
opacity: btnEnabled ? 1.0 : 0.4
color: (nbArea.containsMouse && btnEnabled) ? theme.surfaceHover : theme.surfaceElevated
// surface-elevated, at app-background-surface-alpha when the wash is up.
// `with-alpha` on an opaque token is a plain alpha set, and
// QbzShell.ambientSurfaceAlpha IS AppearanceState.app-background-surface
// -alpha — same QBZ_BG_SURFACE_ALPHA knob, same 0.5 default
// (settings_qt.rs:211 / state.slint:3374).
color: (nbArea.containsMouse && btnEnabled)
? theme.surfaceHover
: (ambientOn
? Qt.rgba(theme.surfaceElevated.r, theme.surfaceElevated.g,
theme.surfaceElevated.b, QbzShell.ambientSurfaceAlpha)
: theme.surfaceElevated)
QbzIcon {
name: parent.name
width: 15
height: 15
anchors.centerIn: parent
tintName: parent.btnEnabled ? "primary" : "muted"
// Whole-pixel centring (Slint rounds this explicitly; 28-15 = 13, so
// `anchors.centerIn` would sit at 6.5px and blur the glyph).
x: Math.round((parent.width - width) / 2)
y: Math.round((parent.height - height) / 2)
tintName: parent.btnEnabled ? "textPrimary" : "muted"
}
MouseArea {
id: nbArea
@@ -73,15 +73,33 @@ Item {
onClicked: parent.parent.parent.viewAllClicked()
}
}
// `ambient: true` on BOTH: these two are the carousel page chevrons,
// and all six Slint carousels give them the third idle-fill arm —
// Carousel / ArtistCarousel / PlaylistCarousel / RadioCarousel /
// SlimCarousel / PinnedCarousel each declare a local `component
// NavButton` at :11-:15 with the identical three-arm `background`
// (verified: same `app-background-active` ->
// `surface-elevated.with-alpha(app-background-surface-alpha)` line in
// all six). Hardcoded rather than exposed as a property because every
// consumer of this header is one of those carousels: HomeView,
// SectionRail, SearchView and LabelView all render inside AppShell's
// frosted contentFrame (AppShell.qml:149, surface-main @0.22), and
// upstream HomeView.slint / SearchResultsView.slint /
// LabelPageView.slint import the carousel components literally. A
// section header on OPAQUE chrome would need the arm off — there is
// no such host today, and adding one means adding the property then,
// not carrying a dead knob now.
QbzNavButton {
visible: parent.parent.showChevrons
name: "chevron-left"
ambient: true
btnEnabled: parent.parent.leftEnabled
onClicked: parent.parent.pageLeft()
}
QbzNavButton {
visible: parent.parent.showChevrons
name: "chevron-right"
ambient: true
btnEnabled: parent.parent.rightEnabled
onClicked: parent.parent.pageRight()
}
@@ -11,11 +11,11 @@
//
// NOT QbzToggle.qml — that one is the on/off SWITCH (checked/toggled(bool)).
//
// LIGHT-THEME CORRECTNESS: icon tints are PRE-BAKED SVG colours
// (assets/icons/<tint>/), and the "primary" bake is literally #ffffff. On a
// light theme the active glyph would paint white on a near-white fill, so the
// bake is chosen from the LIVE token's lightness — the same rule
// QbzIconButton.qml and QbzCircleAction.qml already carry.
// LIGHT-THEME CORRECTNESS: the active fill is `surface-hover`, a THEME
// surface, so the active glyph is `text-primary` — a runtime-tinted token
// (src/icon_tint_qt.rs), not the fixed #ffffff the "primary" bake is. The
// old lightness ternary that picked between two fixed bakes is gone; the
// tinter reproduces the live token exactly.
import QtQuick
import com.blitzfc.qbz
@@ -33,7 +33,7 @@ Rectangle {
QbzTheme { id: theme }
readonly property string tintStrong: theme.textPrimary.hslLightness > 0.5 ? "primary" : "black"
readonly property string tintStrong: "textPrimary"
width: sm ? 30 : 34
height: sm ? 30 : 34