mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-10-20 03:01:52 +08:00
[feat] add website update button to about dialog
This commit is contained in:
@@ -1740,6 +1740,7 @@ void GuiApplication::BindMainCallbacks(bool gallery_window) {
|
||||
OpenUrl(latest && !latest->download_url.empty() ? latest->download_url
|
||||
: "https://crossdesk.cn");
|
||||
});
|
||||
main->on_open_website([this] { OpenUrl("https://crossdesk.cn"); });
|
||||
main->on_open_afdian_sponsor([this] {
|
||||
OpenUrl("https://afdian.com/a/kunkundi");
|
||||
});
|
||||
|
||||
@@ -492,6 +492,7 @@ export component MainWindow inherits Window {
|
||||
callback cancel-self-hosted-settings;
|
||||
callback browse-save-path;
|
||||
callback open-download;
|
||||
callback open-website;
|
||||
callback open-afdian-sponsor;
|
||||
callback open-github-sponsor;
|
||||
callback open-kofi-sponsor;
|
||||
@@ -2446,6 +2447,15 @@ export component MainWindow inherits Window {
|
||||
font-size: 12px; wrap: word-wrap; overflow: elide;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
if root.update-available: WorkbenchButton {
|
||||
width: max(80px, about-update-button-metrics.preferred-width + 24px);
|
||||
height: 32px;
|
||||
primary: true;
|
||||
text-size: 12px;
|
||||
text: UiStrings.download;
|
||||
clicked => { root.open-website(); }
|
||||
about-update-button-metrics := Text { visible: false; text: UiStrings.download; font-size: 12px; }
|
||||
}
|
||||
SettingsButton {
|
||||
width: max(116px, check-button-metrics.preferred-width + 24px);
|
||||
text: UiStrings.check-for-updates;
|
||||
|
||||
Reference in New Issue
Block a user