Skip to content

Commit

Permalink
Add a "check for updates" button on the about view.
Browse files Browse the repository at this point in the history
  • Loading branch information
funway committed Nov 10, 2020
1 parent a3a304b commit 8f539e1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Countdown/Helper/Global.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import XCGLogger
import SQLite

let _appVerion = "1.1.5"
let _appVerion = "1.1.6"
#if DEBUG
let appVersion = _appVerion + " (Debug)"
#else
Expand Down
19 changes: 13 additions & 6 deletions Countdown/View/PreferencesView/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ struct AboutView: View {

var body: some View {
VStack(spacing: 10.0) {
HStack(spacing: 10.0) {
Image(nsImage: NSApplication.shared.applicationIconImage).resizable().frame(width: 48, height: 48)
HStack(spacing: 15.0) {
Image(nsImage: NSApplication.shared.applicationIconImage).resizable().frame(width: 64, height: 64)

VStack(alignment: .leading) {
VStack(alignment: .leading, spacing: 3.0) {
Text("Countdown").font(Font.system(size: 20, weight: .medium).monospacedDigit())
Text(NSLocalizedString("About.version", comment: "") + " \(appVersion)").font(Font.system(size: 13, weight: .regular).monospacedDigit())

HStack {
Text(NSLocalizedString("About.Version", comment: "") + " \(appVersion)").font(Font.system(size: 13, weight: .regular).monospacedDigit())

HyperLinkButton(destination: URL(string: "https://github.com/funway/Countdown/releases")!, label: {
Text(NSLocalizedString("About.Check", comment: "")).font(Font.system(size: 13, weight: .regular).monospacedDigit())
})
}
}
}

Expand Down Expand Up @@ -54,7 +61,7 @@ struct AboutView: View {
Text("😜")
}

Divider()
Divider().padding(.vertical, 5)

ScrollView {
VStack(spacing: 5.0) {
Expand All @@ -81,6 +88,6 @@ struct AboutView: View {

struct AboutView_Previews: PreviewProvider {
static var previews: some View {
AboutView()
AboutView().frame(width: 350)
}
}
2 changes: 1 addition & 1 deletion Countdown/View/PreferencesView/PreferencesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct PreferencesView: View {
.padding(.horizontal)
} else if (selectedTabIndex == 1) {
AboutView()
.frame(height: 320)
.frame(height: 330)
.padding(.horizontal)
.padding(.bottom, 20)
}
Expand Down
2 changes: 1 addition & 1 deletion Countdown/View/PreferencesView/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ struct SettingsView: View {

struct SettingsView_Previews: PreviewProvider {
static var previews: some View {
SettingsView()
SettingsView().frame(width: 350)
}
}
3 changes: 2 additions & 1 deletion Countdown/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"Settings.Remind me" = "Remind me:";
"Settings.Sticky note" = "Sticky note:";

"About.version" = "version";
"About.Version" = "Version";
"About.Check" = "Check";
"About.Author" = "Author:";
"About.Donate me with" = "Donate me with";
"About.or" = "or";
Expand Down
3 changes: 2 additions & 1 deletion Countdown/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"Settings.Remind me" = "到期提醒:";
"Settings.Sticky note" = "桌面便签:";

"About.version" = "版本";
"About.Version" = "版本";
"About.Check" = "检查";
"About.Author" = "作者:";
"About.Donate me with" = "打赏作者:";
"About.or" = "或";
Expand Down

0 comments on commit 8f539e1

Please sign in to comment.