[feat] show sponsorship prompt once per version

This commit is contained in:
dijunkun
2026-10-19 23:06:14 +08:00
parent e7a49361f7
commit 8a7de23c7f
6 changed files with 31 additions and 23 deletions
+6 -4
View File
@@ -2289,15 +2289,16 @@ export component MainWindow inherits Window {
width: min(480px, parent.width - 40px);
height: self.content-top + sponsorship-content.preferred-height + 24px;
title: UiStrings.sponsorship-title;
close-label: MessageStrings.close;
close => { root.dismiss-sponsorship(); }
show-close-button: false;
sponsorship-content := VerticalLayout {
x: 24px; y: parent.content-top;
width: parent.width - 48px; height: self.preferred-height;
padding: 0px; spacing: 18px;
padding: 0px; spacing: 20px;
Text {
text: UiStrings.sponsorship-message;
color: WorkbenchStyle.text; font-size: 13px; wrap: word-wrap;
color: WorkbenchStyle.text; font-size: 14px; wrap: word-wrap;
// Match message bodies' 1.5em line height for wrapped text.
font-family: "CrossDesk Message Spacing";
}
SponsorshipSection {
show-title: false;
@@ -2308,6 +2309,7 @@ export component MainWindow inherits Window {
Text {
text: UiStrings.sponsorship-dismiss-hint;
color: WorkbenchStyle.muted; font-size: 12px; wrap: word-wrap;
font-family: "CrossDesk Message Spacing";
}
Rectangle { height: 1px; background: WorkbenchStyle.separator; }
HorizontalLayout {
@@ -49,6 +49,7 @@ export component SettingsButton inherits Rectangle {
export component SettingsDialog inherits DialogSurface {
in property <string> title;
in property <string> close-label;
in property <bool> show-close-button: true;
in property <int> badge-count: 0;
in property <string> badge-label;
in property <string> header-status;
@@ -92,7 +93,7 @@ export component SettingsDialog inherits DialogSurface {
clicked => { root.action(); }
action-label-metrics := Text { visible: false; text: root.action-text; font-size: 12px; }
}
IconButton {
if root.show-close-button: IconButton {
width: 28px; height: 28px;
icon: FontAwesomeIcons.xmark; icon-size: 14px;
icon-color: WorkbenchStyle.muted;