[ui] add release notes button to about dialog

This commit is contained in:
dijunkun
2026-10-10 03:07:56 +08:00
parent 58ca67fa25
commit 420e7a8cbb
5 changed files with 21 additions and 5 deletions
@@ -289,6 +289,7 @@ struct TranslationRow {
"Check failed. Please try again later.", \
u8"Не удалось проверить обновления. Повторите позже.") \
X(release_notes, u8"更新内容", "Release Notes", u8"Содержание обновления") \
X(view_release_notes, u8"更新日志", "Release notes", u8"История изменений") \
X(version, u8"版本", "Version", u8"Версия") \
X(release_date, u8"发布日期: ", "Release Date: ", u8"Дата релиза: ") \
X(access_website, u8"访问官网: ", \
+17 -3
View File
@@ -72,6 +72,7 @@ export global UiStrings {
in-out property <string> up-to-date: "You’re up to date";
in-out property <string> update-check-failed: "Check failed. Please try again later.";
in-out property <string> release-notes: "Release notes";
in-out property <string> view-release-notes: "Release notes";
in-out property <string> later: "Later";
in-out property <string> download: "Download";
in-out property <string> input-password: "Input password";
@@ -1887,7 +1888,7 @@ export component MainWindow inherits Window {
x: (root.width - self.width) / 2;
y: (root.height - self.height) / 2;
width: 320px;
height: 216px;
height: max(216px, about-content.preferred-height);
border-radius: 7px;
Rectangle {
@@ -1901,8 +1902,8 @@ export component MainWindow inherits Window {
Rectangle { y: parent.height - 7px; height: 7px; background: #d3d3d3; }
Text { x: 6px; text: UiStrings.about; font-size: ImGuiFontStyle.base; font-weight: 600; color: #202124; vertical-alignment: center; }
}
// Keep the dialog/footer stable while visible text rows determine
// each group's size and the layout redistributes the space between.
// Grow for update actions and wrapped translations while keeping
// the footer below the version and check result.
about-content := VerticalLayout {
padding: 16px;
padding-top: 35px;
@@ -1942,6 +1943,19 @@ export component MainWindow inherits Window {
clicked => { root.about-open = false; root.update-open = true; }
}
}
if root.update-available: HorizontalLayout {
alignment: start;
padding-top: 4px;
CompactButton {
width: max(76px, release-notes-button-metrics.preferred-width + 20px);
text: UiStrings.view-release-notes;
accessible-role: button;
accessible-label: self.text;
accessible-action-default => { self.clicked(); }
clicked => { root.about-open = false; root.update-open = true; }
release-notes-button-metrics := Text { visible: false; text: UiStrings.view-release-notes; font-size: ImGuiFontStyle.body; }
}
}
if root.update-status-text != "": Text {
text: root.update-status-text;
color: root.update-check-status == UpdateCheckStatus.failed ? #b3261e : #61656c;
@@ -120,6 +120,7 @@ inline int ApplyMainWindowStrings(
strings.set_update_check_failed(
Text(localization::update_check_failed[language]));
strings.set_release_notes(Text(localization::release_notes[language]));
strings.set_view_release_notes(Text(localization::view_release_notes[language]));
strings.set_download(Text(localization::update[language]));
strings.set_input_password(Text(localization::input_password[language]));
strings.set_reinput_password(Text(localization::reinput_password[language]));