widget text spacing

This commit is contained in:
Stuart Breckenridge 2020-12-23 21:16:32 +08:00
parent 6ed662278a
commit 3898edc8b1
No known key found for this signature in database
GPG Key ID: ED2F112EEA9EF8A5
4 changed files with 19 additions and 14 deletions

View File

@ -23,7 +23,7 @@ struct StarredWidgetView : View {
else {
GeometryReader { metrics in
HStack(alignment: .top, spacing: 4) {
VStack(alignment: .leading) {
VStack(alignment: .leading, spacing: -4) {
starredImage
Spacer()
Text(L10n.localizedCount(entry.widgetData.currentStarredCount)).bold().font(.callout).minimumScaleFactor(0.5).lineLimit(1)

View File

@ -23,7 +23,7 @@ struct TodayWidgetView : View {
else {
GeometryReader { metrics in
HStack(alignment: .top, spacing: 4) {
VStack(alignment: .leading) {
VStack(alignment: .leading, spacing: -4) {
todayImage
Spacer()
Text(L10n.localizedCount(entry.widgetData.currentTodayCount)).bold().font(.callout).minimumScaleFactor(0.5).lineLimit(1)

View File

@ -23,7 +23,7 @@ struct UnreadWidgetView : View {
else {
GeometryReader { metrics in
HStack(alignment: .top, spacing: 4) {
VStack(alignment: .leading) {
VStack(alignment: .leading, spacing: -4) {
unreadImage
Spacer()
Text(L10n.localizedCount(entry.widgetData.currentUnreadCount)).bold().font(.callout).minimumScaleFactor(0.5).lineLimit(1)

View File

@ -430,12 +430,15 @@ private extension AppDelegate {
}
account!.markArticles(article!, statusKey: .read, flag: true)
self.prepareAccountsForBackground()
if !AccountManager.shared.isSuspended {
if #available(iOS 14, *) {
try? WidgetDataEncoder.shared.encodeWidgetData()
account!.syncArticleStatus(completion: { [weak self] _ in
if !AccountManager.shared.isSuspended {
if #available(iOS 14, *) {
try? WidgetDataEncoder.shared.encodeWidgetData()
}
self?.prepareAccountsForBackground()
self?.suspendApplication()
}
self.suspendApplication()
}
})
}
func handleMarkAsStarred(userInfo: [AnyHashable: Any]) {
@ -456,12 +459,14 @@ private extension AppDelegate {
return
}
account!.markArticles(article!, statusKey: .starred, flag: true)
self.prepareAccountsForBackground()
if !AccountManager.shared.isSuspended {
if #available(iOS 14, *) {
try? WidgetDataEncoder.shared.encodeWidgetData()
account!.syncArticleStatus(completion: { [weak self] _ in
if !AccountManager.shared.isSuspended {
if #available(iOS 14, *) {
try? WidgetDataEncoder.shared.encodeWidgetData()
}
self?.prepareAccountsForBackground()
self?.suspendApplication()
}
self.suspendApplication()
}
})
}
}