The About modal codename is a hand-set literal and still said 1.2.15's 'Just cleaning'; it now matches the 2.0.0 TAG_DETAILS headline. cc
532 lines
23 KiB
Plaintext
532 lines
23 KiB
Plaintext
// About QBZ modal — the native port of Tauri's AboutModal.svelte.
|
|
//
|
|
// Opened from the header hamburger menu ("About QBZ"). Static content seeded by
|
|
// crate::about into AboutState: app branding + version, the description, the
|
|
// Qobuz legal notice, an external-links row, the build-info grid, a one-line
|
|
// acknowledgments paragraph, the author + contributors (clickable chips with
|
|
// GitHub avatars that open the profile), and the signature footer.
|
|
//
|
|
// Layout mirrors LogViewerModal / QconnectDevModal: a dimmed full-window
|
|
// backdrop that closes on click, a centered card that swallows clicks, a header
|
|
// (branding + X), and a scrolling body. Mounted in AppShell in declaration
|
|
// order so its z-order is the mount order (ADR-009); conditional-mounted on
|
|
// AboutState.open (ADR-010). No pills (ADR-008): the author + contributor rows
|
|
// are bordered Radius.sm chips, not pills.
|
|
|
|
import { Theme } from "../foundation/semantic-colors.slint";
|
|
import { Typography } from "../foundation/typography.slint";
|
|
import { Radius } from "../foundation/radius.slint";
|
|
import { AboutState, AboutActions } from "../state.slint";
|
|
import { QbzIcon } from "../primitives/QbzIcon.slint";
|
|
|
|
// A bordered icon+label link button used by the external-links row.
|
|
component LinkButton inherits Rectangle {
|
|
in property <string> label;
|
|
in property <image> icon;
|
|
callback clicked();
|
|
|
|
height: 34px;
|
|
width: row.preferred-width;
|
|
border-radius: Radius.sm;
|
|
border-width: 1px;
|
|
border-color: Theme.border-subtle;
|
|
background: ta.has-hover ? Theme.surface-hover : Theme.surface-elevated;
|
|
|
|
row := HorizontalLayout {
|
|
padding-left: 14px;
|
|
padding-right: 14px;
|
|
spacing: 8px;
|
|
VerticalLayout {
|
|
alignment: center;
|
|
QbzIcon {
|
|
source: root.icon;
|
|
width: 15px;
|
|
height: 15px;
|
|
tint: ta.has-hover ? Theme.text-primary : Theme.text-secondary;
|
|
}
|
|
}
|
|
Text {
|
|
text: root.label;
|
|
color: ta.has-hover ? Theme.text-primary : Theme.text-secondary;
|
|
font-size: 13px;
|
|
font-weight: Typography.medium;
|
|
vertical-alignment: center;
|
|
}
|
|
VerticalLayout {
|
|
alignment: center;
|
|
QbzIcon {
|
|
source: @image-url("../assets/icons/external-link.svg");
|
|
width: 11px;
|
|
height: 11px;
|
|
tint: Theme.text-muted;
|
|
}
|
|
}
|
|
}
|
|
|
|
ta := TouchArea {
|
|
mouse-cursor: pointer;
|
|
clicked => {
|
|
root.clicked();
|
|
}
|
|
}
|
|
}
|
|
|
|
// A bordered, clickable handle chip (author + contributors) with a round GitHub
|
|
// avatar. NOT a pill — Radius.sm + a subtle border, per ADR-008. The avatar is
|
|
// loaded async (crate::about) and stays a blank circle until it arrives.
|
|
component HandleChip inherits Rectangle {
|
|
in property <string> name;
|
|
in property <string> url;
|
|
in property <image> avatar;
|
|
in property <length> text-size: 13px;
|
|
in property <length> avatar-size: 20px;
|
|
callback clicked();
|
|
|
|
height: 28px;
|
|
width: chip-row.preferred-width;
|
|
border-radius: Radius.sm;
|
|
border-width: 1px;
|
|
border-color: Theme.border-subtle;
|
|
background: hc-ta.has-hover ? Theme.surface-hover : Theme.surface-elevated;
|
|
|
|
chip-row := HorizontalLayout {
|
|
padding-left: 5px;
|
|
padding-right: 11px;
|
|
spacing: 7px;
|
|
VerticalLayout {
|
|
alignment: center;
|
|
// Round avatar: clip a circle (border-radius = half size) around a
|
|
// cover-fit Image. Blank (surface) until the avatar loads.
|
|
Rectangle {
|
|
width: root.avatar-size;
|
|
height: root.avatar-size;
|
|
border-radius: root.avatar-size / 2;
|
|
clip: true;
|
|
background: Theme.surface-hover;
|
|
Image {
|
|
width: 100%;
|
|
height: 100%;
|
|
source: root.avatar;
|
|
image-fit: cover;
|
|
}
|
|
}
|
|
}
|
|
Text {
|
|
text: root.name;
|
|
color: hc-ta.has-hover ? Theme.accent : Theme.text-primary;
|
|
font-size: root.text-size;
|
|
font-weight: Typography.medium;
|
|
vertical-alignment: center;
|
|
}
|
|
VerticalLayout {
|
|
alignment: center;
|
|
QbzIcon {
|
|
source: @image-url("../assets/icons/external-link.svg");
|
|
width: 10px;
|
|
height: 10px;
|
|
tint: Theme.text-muted;
|
|
}
|
|
}
|
|
}
|
|
|
|
hc-ta := TouchArea {
|
|
mouse-cursor: pointer;
|
|
clicked => {
|
|
root.clicked();
|
|
}
|
|
}
|
|
}
|
|
|
|
// A small uppercase section heading used throughout the body.
|
|
component SectionHeading inherits Text {
|
|
color: Theme.text-muted;
|
|
font-size: 11px;
|
|
font-weight: Typography.semibold;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
export component AboutModal inherits Rectangle {
|
|
width: 100%;
|
|
height: 100%;
|
|
visible: AboutState.open;
|
|
|
|
if AboutState.open: Rectangle {
|
|
background: #000000bf;
|
|
TouchArea {
|
|
mouse-cursor: default;
|
|
clicked => {
|
|
AboutState.open = false;
|
|
}
|
|
}
|
|
|
|
Rectangle {
|
|
width: Math.min(root.width - 80px, 840px);
|
|
height: Math.min(root.height - 80px, 770px);
|
|
x: Math.round((parent.width - self.width) / 2 / 1px) * 1px;
|
|
y: Math.round((parent.height - self.height) / 2 / 1px) * 1px;
|
|
border-radius: Radius.md;
|
|
background: Theme.surface-card;
|
|
border-width: 1px;
|
|
border-color: Theme.border-subtle;
|
|
drop-shadow-blur: 32px;
|
|
drop-shadow-color: #00000080;
|
|
// Swallow clicks so they don't reach the closing backdrop.
|
|
TouchArea { }
|
|
|
|
VerticalLayout {
|
|
padding: 24px;
|
|
spacing: 0px;
|
|
|
|
// ---- Header: app branding + close X.
|
|
HorizontalLayout {
|
|
spacing: 16px;
|
|
Image {
|
|
// 128px source (not the 512px original): a ~2.3x
|
|
// downscale renders crisp at 56px, where the 9x downscale
|
|
// from 512 aliased badly (femtovg has no mipmaps).
|
|
source: @image-url("../assets/qbz-logo-128.png");
|
|
width: 56px;
|
|
height: 56px;
|
|
image-fit: contain;
|
|
}
|
|
VerticalLayout {
|
|
alignment: center;
|
|
spacing: 2px;
|
|
horizontal-stretch: 1;
|
|
Text {
|
|
text: "QBZ";
|
|
color: Theme.text-primary;
|
|
font-size: Typography.title;
|
|
font-weight: Typography.bold;
|
|
}
|
|
Text {
|
|
text: "v" + AboutState.version;
|
|
color: Theme.text-muted;
|
|
font-size: Typography.legal;
|
|
}
|
|
}
|
|
close-x := TouchArea {
|
|
width: 28px;
|
|
height: 28px;
|
|
mouse-cursor: pointer;
|
|
clicked => {
|
|
AboutState.open = false;
|
|
}
|
|
QbzIcon {
|
|
source: @image-url("../assets/icons/x.svg");
|
|
width: 17px;
|
|
height: 17px;
|
|
x: Math.round((parent.width - self.width) / 2 / 1px) * 1px;
|
|
y: Math.round((parent.height - self.height) / 2 / 1px) * 1px;
|
|
tint: close-x.has-hover ? Theme.text-primary : Theme.text-muted;
|
|
}
|
|
}
|
|
}
|
|
|
|
Rectangle { height: 16px; }
|
|
Rectangle {
|
|
height: 1px;
|
|
background: Theme.border-subtle;
|
|
}
|
|
Rectangle { height: 16px; }
|
|
|
|
// ---- Scrolling body.
|
|
Flickable {
|
|
vertical-stretch: 1;
|
|
viewport-width: self.width;
|
|
viewport-height: about-body.preferred-height;
|
|
|
|
about-body := VerticalLayout {
|
|
width: parent.width;
|
|
spacing: 0px;
|
|
|
|
// Description.
|
|
Text {
|
|
text: @tr("A native music streaming client for Linux, designed for audiophiles who need bit-perfect Hi-Fi playback.");
|
|
color: Theme.text-secondary;
|
|
font-size: 14px;
|
|
wrap: word-wrap;
|
|
}
|
|
|
|
Rectangle { height: 16px; }
|
|
|
|
// Qobuz legal notice (branding + trademark lines).
|
|
Text {
|
|
text: @tr("This application uses the Qobuz API but is not certified by Qobuz.");
|
|
color: Theme.text-muted;
|
|
font-size: 12px;
|
|
wrap: word-wrap;
|
|
}
|
|
Rectangle { height: 8px; }
|
|
Text {
|
|
text: @tr("Qobuz™ is a trademark of Qobuz. QBZ is an open-source application licensed under the MIT License and is not affiliated with, endorsed by, or certified by Qobuz.");
|
|
color: Theme.text-muted;
|
|
// 11px so the trademark notice wraps to two lines
|
|
// instead of three.
|
|
font-size: 11px;
|
|
wrap: word-wrap;
|
|
}
|
|
|
|
Rectangle { height: 22px; }
|
|
|
|
// External links.
|
|
HorizontalLayout {
|
|
spacing: 12px;
|
|
alignment: start;
|
|
LinkButton {
|
|
label: "GitHub";
|
|
icon: @image-url("../assets/icons/external-link.svg");
|
|
clicked => {
|
|
AboutActions.open-url("https://github.com/vicrodh/qbz");
|
|
}
|
|
}
|
|
LinkButton {
|
|
label: @tr("Release");
|
|
icon: @image-url("../assets/icons/external-link.svg");
|
|
clicked => {
|
|
AboutActions.open-url(AboutState.release-url);
|
|
}
|
|
}
|
|
LinkButton {
|
|
label: @tr("Website");
|
|
icon: @image-url("../assets/icons/globe.svg");
|
|
clicked => {
|
|
AboutActions.open-url("https://qbz.lol");
|
|
}
|
|
}
|
|
}
|
|
|
|
Rectangle { height: 24px; }
|
|
|
|
// Build info.
|
|
SectionHeading { text: @tr("Build Info"); }
|
|
Rectangle { height: 12px; }
|
|
HorizontalLayout {
|
|
spacing: 16px;
|
|
// Two label/value columns side by side.
|
|
VerticalLayout {
|
|
horizontal-stretch: 1;
|
|
spacing: 6px;
|
|
HorizontalLayout {
|
|
spacing: 12px;
|
|
Text {
|
|
text: @tr("Version");
|
|
color: Theme.text-muted;
|
|
font-size: 13px;
|
|
width: 84px;
|
|
}
|
|
Text {
|
|
text: AboutState.version;
|
|
color: Theme.text-primary;
|
|
font-size: 13px;
|
|
horizontal-stretch: 1;
|
|
}
|
|
}
|
|
HorizontalLayout {
|
|
spacing: 12px;
|
|
Text {
|
|
text: @tr("License");
|
|
color: Theme.text-muted;
|
|
font-size: 13px;
|
|
width: 84px;
|
|
}
|
|
Text {
|
|
text: "MIT";
|
|
color: Theme.text-primary;
|
|
font-size: 13px;
|
|
horizontal-stretch: 1;
|
|
}
|
|
}
|
|
HorizontalLayout {
|
|
spacing: 12px;
|
|
Text {
|
|
text: @tr("Build");
|
|
color: Theme.text-muted;
|
|
font-size: 13px;
|
|
width: 84px;
|
|
}
|
|
Text {
|
|
text: AboutState.build-commit == ""
|
|
? AboutState.build-date
|
|
: AboutState.build-date + " (" + AboutState.build-commit + ")";
|
|
color: Theme.text-primary;
|
|
font-size: 13px;
|
|
horizontal-stretch: 1;
|
|
overflow: elide;
|
|
}
|
|
}
|
|
}
|
|
VerticalLayout {
|
|
horizontal-stretch: 1;
|
|
spacing: 6px;
|
|
HorizontalLayout {
|
|
spacing: 12px;
|
|
Text {
|
|
text: @tr("Codename");
|
|
color: Theme.text-muted;
|
|
font-size: 13px;
|
|
width: 84px;
|
|
}
|
|
Text {
|
|
text: "Rebuild 破 (You Can (Not) Advance)";
|
|
color: Theme.text-secondary;
|
|
font-size: 13px;
|
|
font-italic: true;
|
|
horizontal-stretch: 1;
|
|
}
|
|
}
|
|
HorizontalLayout {
|
|
spacing: 12px;
|
|
Text {
|
|
text: @tr("Platform");
|
|
color: Theme.text-muted;
|
|
font-size: 13px;
|
|
width: 84px;
|
|
}
|
|
Text {
|
|
text: AboutState.platform-label;
|
|
color: Theme.text-primary;
|
|
font-size: 13px;
|
|
horizontal-stretch: 1;
|
|
overflow: elide;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Rectangle { height: 24px; }
|
|
|
|
// Acknowledgments. Collapsed to a single prose paragraph
|
|
// (was a 10-row credits list) so the Contributors section
|
|
// fits without scrolling.
|
|
SectionHeading { text: @tr("Acknowledgments"); }
|
|
Rectangle { height: 12px; }
|
|
Text {
|
|
text: @tr("Built with Rust and Slint, and powered by Rodio and Symphonia. With thanks to Qobuz, MusicBrainz, Song.link/Odesli, LRCLIB, lyrics.ovh, and Lucide.");
|
|
color: Theme.text-secondary;
|
|
font-size: 12px;
|
|
wrap: word-wrap;
|
|
}
|
|
|
|
Rectangle { height: 24px; }
|
|
|
|
// Author.
|
|
SectionHeading { text: @tr("Author"); }
|
|
Rectangle { height: 12px; }
|
|
HorizontalLayout {
|
|
alignment: start;
|
|
HandleChip {
|
|
name: AboutState.author-name;
|
|
url: AboutState.author-url;
|
|
avatar: AboutState.author-avatar;
|
|
text-size: 14px;
|
|
avatar-size: 22px;
|
|
clicked => {
|
|
AboutActions.open-url(AboutState.author-url);
|
|
}
|
|
}
|
|
}
|
|
|
|
Rectangle { height: 24px; }
|
|
|
|
// Contributors. Slint has no flex-wrap, so crate::about
|
|
// pre-groups the chips into fixed rows (4 per row): the
|
|
// outer VerticalLayout walks the groups, the inner
|
|
// HorizontalLayout walks each row's chips. Mirrors the
|
|
// Tauri flex-wrap density without empty-slot spacing.
|
|
SectionHeading { text: @tr("Contributors"); }
|
|
Rectangle { height: 12px; }
|
|
contributors-flow := VerticalLayout {
|
|
spacing: 8px;
|
|
for group in AboutState.contributor-rows: HorizontalLayout {
|
|
alignment: start;
|
|
spacing: 8px;
|
|
for ack in group.items: HandleChip {
|
|
name: ack.name;
|
|
url: ack.url;
|
|
avatar: ack.avatar;
|
|
clicked => {
|
|
AboutActions.open-url(ack.url);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Rectangle { height: 24px; }
|
|
Rectangle {
|
|
height: 1px;
|
|
background: Theme.border-subtle;
|
|
}
|
|
Rectangle { height: 18px; }
|
|
|
|
// Signature.
|
|
VerticalLayout {
|
|
spacing: 8px;
|
|
HorizontalLayout {
|
|
alignment: center;
|
|
spacing: 6px;
|
|
Text {
|
|
text: @tr("Made with");
|
|
color: Theme.text-muted;
|
|
font-size: 12px;
|
|
vertical-alignment: center;
|
|
}
|
|
// "love" struck through with an overlaid hairline —
|
|
// Slint Text has no text-decoration, so the strike is
|
|
// a 1px Rectangle centered over the glyphs.
|
|
love-wrap := Rectangle {
|
|
width: love-txt.preferred-width;
|
|
height: love-txt.preferred-height;
|
|
love-txt := Text {
|
|
text: "love";
|
|
color: Theme.text-disabled;
|
|
font-size: 12px;
|
|
vertical-alignment: center;
|
|
}
|
|
Rectangle {
|
|
width: parent.width;
|
|
height: 1px;
|
|
y: Math.round((parent.height - self.height) / 2 / 1px) * 1px;
|
|
background: Theme.text-disabled;
|
|
}
|
|
}
|
|
Text {
|
|
text: "hate";
|
|
color: Theme.text-secondary;
|
|
font-size: 12px;
|
|
font-weight: Typography.semibold;
|
|
vertical-alignment: center;
|
|
}
|
|
Text {
|
|
text: @tr("in");
|
|
color: Theme.text-muted;
|
|
font-size: 12px;
|
|
vertical-alignment: center;
|
|
}
|
|
// Flag as an SVG Image (not a 🇲🇽 emoji — regional-
|
|
// indicator flags degrade to "MX" on many Linux font
|
|
// stacks under femtovg). Matches the Tauri build.
|
|
Image {
|
|
source: @image-url("../assets/mexico-flag.svg");
|
|
width: 18px;
|
|
height: 12px;
|
|
image-fit: contain;
|
|
}
|
|
}
|
|
Text {
|
|
text: @tr("Hatred towards all those companies that discriminate against the Linux community and don't provide us with a decent client for their product.");
|
|
color: Theme.text-muted;
|
|
font-size: 11px;
|
|
horizontal-alignment: center;
|
|
wrap: word-wrap;
|
|
}
|
|
}
|
|
|
|
Rectangle { height: 4px; }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|