Widget
• Hides count text when there are no articles beyond what is displayed. • Fixes html appearing in titles.
This commit is contained in:
parent
4414ea6c06
commit
474fbedbc3
NetNewsWire.xcodeproj
Shared/Widget
Widget
@ -134,6 +134,8 @@
|
|||||||
17D5F19524B0C1DD00375168 /* SidebarToolbarModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 172199F024AB716900A31D04 /* SidebarToolbarModifier.swift */; };
|
17D5F19524B0C1DD00375168 /* SidebarToolbarModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 172199F024AB716900A31D04 /* SidebarToolbarModifier.swift */; };
|
||||||
17E0084625941887000C23F0 /* SizeCategories.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17E0084525941887000C23F0 /* SizeCategories.swift */; };
|
17E0084625941887000C23F0 /* SizeCategories.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17E0084525941887000C23F0 /* SizeCategories.swift */; };
|
||||||
17E4DBD624BFC53E00FE462A /* AdvancedPreferencesModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17E4DBD524BFC53E00FE462A /* AdvancedPreferencesModel.swift */; };
|
17E4DBD624BFC53E00FE462A /* AdvancedPreferencesModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17E4DBD524BFC53E00FE462A /* AdvancedPreferencesModel.swift */; };
|
||||||
|
17EF6A2125C4E5B4002C9F81 /* RSWeb in Frameworks */ = {isa = PBXBuildFile; productRef = 17EF6A2025C4E5B4002C9F81 /* RSWeb */; };
|
||||||
|
17EF6A2225C4E5B4002C9F81 /* RSWeb in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 17EF6A2025C4E5B4002C9F81 /* RSWeb */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||||
27B86EEB25A53AAB00264340 /* Account in Frameworks */ = {isa = PBXBuildFile; productRef = 51BC2F4A24D343A500E90810 /* Account */; };
|
27B86EEB25A53AAB00264340 /* Account in Frameworks */ = {isa = PBXBuildFile; productRef = 51BC2F4A24D343A500E90810 /* Account */; };
|
||||||
27B86EEC25A53AAB00264340 /* Articles in Frameworks */ = {isa = PBXBuildFile; productRef = 17E0080E25936DF6000C23F0 /* Articles */; };
|
27B86EEC25A53AAB00264340 /* Articles in Frameworks */ = {isa = PBXBuildFile; productRef = 17E0080E25936DF6000C23F0 /* Articles */; };
|
||||||
27B86EED25A53AAB00264340 /* ArticlesDatabase in Frameworks */ = {isa = PBXBuildFile; productRef = 17E0081125936DF6000C23F0 /* ArticlesDatabase */; };
|
27B86EED25A53AAB00264340 /* ArticlesDatabase in Frameworks */ = {isa = PBXBuildFile; productRef = 17E0081125936DF6000C23F0 /* ArticlesDatabase */; };
|
||||||
@ -1232,6 +1234,17 @@
|
|||||||
/* End PBXContainerItemProxy section */
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
||||||
/* Begin PBXCopyFilesBuildPhase section */
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
17EF6A1725C4E59D002C9F81 /* Embed Frameworks */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
dstPath = "";
|
||||||
|
dstSubfolderSpec = 10;
|
||||||
|
files = (
|
||||||
|
17EF6A2225C4E5B4002C9F81 /* RSWeb in Embed Frameworks */,
|
||||||
|
);
|
||||||
|
name = "Embed Frameworks";
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
5102AE7324D17FAA0050839C /* Embed Frameworks */ = {
|
5102AE7324D17FAA0050839C /* Embed Frameworks */ = {
|
||||||
isa = PBXCopyFilesBuildPhase;
|
isa = PBXCopyFilesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
@ -2045,6 +2058,7 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
17EF6A2125C4E5B4002C9F81 /* RSWeb in Frameworks */,
|
||||||
176813F72564BB2C00D98635 /* SwiftUI.framework in Frameworks */,
|
176813F72564BB2C00D98635 /* SwiftUI.framework in Frameworks */,
|
||||||
176813F52564BB2C00D98635 /* WidgetKit.framework in Frameworks */,
|
176813F52564BB2C00D98635 /* WidgetKit.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
@ -3705,12 +3719,16 @@
|
|||||||
176813F02564BB2C00D98635 /* Frameworks */,
|
176813F02564BB2C00D98635 /* Frameworks */,
|
||||||
176813F12564BB2C00D98635 /* Resources */,
|
176813F12564BB2C00D98635 /* Resources */,
|
||||||
1701E1BF25689B44009453D8 /* SwiftGen Localization */,
|
1701E1BF25689B44009453D8 /* SwiftGen Localization */,
|
||||||
|
17EF6A1725C4E59D002C9F81 /* Embed Frameworks */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
dependencies = (
|
dependencies = (
|
||||||
);
|
);
|
||||||
name = "NetNewsWire iOS Widget Extension";
|
name = "NetNewsWire iOS Widget Extension";
|
||||||
|
packageProductDependencies = (
|
||||||
|
17EF6A2025C4E5B4002C9F81 /* RSWeb */,
|
||||||
|
);
|
||||||
productName = "NetNewsWire WidgetExtension";
|
productName = "NetNewsWire WidgetExtension";
|
||||||
productReference = 176813F32564BB2C00D98635 /* NetNewsWire iOS Widget Extension.appex */;
|
productReference = 176813F32564BB2C00D98635 /* NetNewsWire iOS Widget Extension.appex */;
|
||||||
productType = "com.apple.product-type.app-extension";
|
productType = "com.apple.product-type.app-extension";
|
||||||
@ -6213,6 +6231,11 @@
|
|||||||
isa = XCSwiftPackageProductDependency;
|
isa = XCSwiftPackageProductDependency;
|
||||||
productName = SyncDatabase;
|
productName = SyncDatabase;
|
||||||
};
|
};
|
||||||
|
17EF6A2025C4E5B4002C9F81 /* RSWeb */ = {
|
||||||
|
isa = XCSwiftPackageProductDependency;
|
||||||
|
package = 51383A3024D1F90E0027E272 /* XCRemoteSwiftPackageReference "RSWeb" */;
|
||||||
|
productName = RSWeb;
|
||||||
|
};
|
||||||
5102AE6824D17F7C0050839C /* RSCore */ = {
|
5102AE6824D17F7C0050839C /* RSCore */ = {
|
||||||
isa = XCSwiftPackageProductDependency;
|
isa = XCSwiftPackageProductDependency;
|
||||||
package = 5102AE4324D17E820050839C /* XCRemoteSwiftPackageReference "RSCore" */;
|
package = 5102AE4324D17E820050839C /* XCRemoteSwiftPackageReference "RSCore" */;
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
"repositoryURL": "https://github.com/tid-kijyun/Kanna.git",
|
"repositoryURL": "https://github.com/tid-kijyun/Kanna.git",
|
||||||
"state": {
|
"state": {
|
||||||
"branch": null,
|
"branch": null,
|
||||||
"revision": "c657fb9f5827ef138068215c76ad0bb62bbc92da",
|
"revision": "4a80ebe93b6966d5083394fcaaaff57a2fcec935",
|
||||||
"version": "5.2.4"
|
"version": "5.2.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -78,8 +78,8 @@
|
|||||||
"repositoryURL": "https://github.com/Ranchero-Software/RSParser.git",
|
"repositoryURL": "https://github.com/Ranchero-Software/RSParser.git",
|
||||||
"state": {
|
"state": {
|
||||||
"branch": null,
|
"branch": null,
|
||||||
"revision": "fd9b9c974d551a9c94d970da90a42571d234efd6",
|
"revision": "a4467cb6ab32d67fa8b09fcef8b234c7f96b7f9c",
|
||||||
"version": "2.0.0-beta4"
|
"version": "2.0.0-beta3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,7 @@ public final class WidgetDataEncoder {
|
|||||||
for article in unreadArticles {
|
for article in unreadArticles {
|
||||||
let latestArticle = LatestArticle(id: article.sortableArticleID,
|
let latestArticle = LatestArticle(id: article.sortableArticleID,
|
||||||
feedTitle: article.sortableName,
|
feedTitle: article.sortableName,
|
||||||
articleTitle: ArticleStringFormatter.truncatedTitle(article).isEmpty ? article.contentHTML?.strippingHTML().trimmingWhitespace : ArticleStringFormatter.truncatedTitle(article),
|
articleTitle: ArticleStringFormatter.truncatedTitle(article).isEmpty ? ArticleStringFormatter.truncatedSummary(article) : ArticleStringFormatter.truncatedTitle(article),
|
||||||
articleSummary: article.summary,
|
articleSummary: article.summary,
|
||||||
feedIcon: article.iconImage()?.image.dataRepresentation(),
|
feedIcon: article.iconImage()?.image.dataRepresentation(),
|
||||||
pubDate: article.datePublished!.description)
|
pubDate: article.datePublished!.description)
|
||||||
@ -55,7 +55,7 @@ public final class WidgetDataEncoder {
|
|||||||
for article in starredArticles {
|
for article in starredArticles {
|
||||||
let latestArticle = LatestArticle(id: article.sortableArticleID,
|
let latestArticle = LatestArticle(id: article.sortableArticleID,
|
||||||
feedTitle: article.sortableName,
|
feedTitle: article.sortableName,
|
||||||
articleTitle: ArticleStringFormatter.truncatedTitle(article).isEmpty ? article.contentHTML?.strippingHTML().trimmingWhitespace : ArticleStringFormatter.truncatedTitle(article),
|
articleTitle: ArticleStringFormatter.truncatedTitle(article).isEmpty ? ArticleStringFormatter.truncatedSummary(article) : ArticleStringFormatter.truncatedTitle(article),
|
||||||
articleSummary: article.summary,
|
articleSummary: article.summary,
|
||||||
feedIcon: article.iconImage()?.image.dataRepresentation(),
|
feedIcon: article.iconImage()?.image.dataRepresentation(),
|
||||||
pubDate: article.datePublished!.description)
|
pubDate: article.datePublished!.description)
|
||||||
@ -66,7 +66,7 @@ public final class WidgetDataEncoder {
|
|||||||
for article in todayArticles {
|
for article in todayArticles {
|
||||||
let latestArticle = LatestArticle(id: article.sortableArticleID,
|
let latestArticle = LatestArticle(id: article.sortableArticleID,
|
||||||
feedTitle: article.sortableName,
|
feedTitle: article.sortableName,
|
||||||
articleTitle: ArticleStringFormatter.truncatedTitle(article).isEmpty ? article.contentHTML?.strippingHTML().trimmingWhitespace : ArticleStringFormatter.truncatedTitle(article),
|
articleTitle: ArticleStringFormatter.truncatedTitle(article).isEmpty ? ArticleStringFormatter.truncatedSummary(article) : ArticleStringFormatter.truncatedTitle(article),
|
||||||
articleSummary: article.summary,
|
articleSummary: article.summary,
|
||||||
feedIcon: article.iconImage()?.image.dataRepresentation(),
|
feedIcon: article.iconImage()?.image.dataRepresentation(),
|
||||||
pubDate: article.datePublished!.description)
|
pubDate: article.datePublished!.description)
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
import RSWeb
|
||||||
|
|
||||||
struct ArticleItemView: View {
|
struct ArticleItemView: View {
|
||||||
|
|
||||||
|
@ -60,10 +60,12 @@ struct StarredWidgetView : View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
HStack {
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
Text(L10n.starredCount(entry.widgetData.currentStarredCount - maxCount()))
|
if entry.widgetData.currentStarredCount - maxCount() > 0 {
|
||||||
.font(.caption2)
|
Text(L10n.starredCount(entry.widgetData.currentStarredCount - maxCount()))
|
||||||
.bold()
|
.font(.caption2)
|
||||||
.foregroundColor(.secondary)
|
.bold()
|
||||||
|
.foregroundColor(.secondary)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
|
@ -60,10 +60,12 @@ struct TodayWidgetView : View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
HStack {
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
Text(L10n.todayCount(entry.widgetData.currentTodayCount - maxCount()))
|
if entry.widgetData.currentTodayCount - maxCount() > 0 {
|
||||||
.font(.caption2)
|
Text(L10n.todayCount(entry.widgetData.currentTodayCount - maxCount()))
|
||||||
.bold()
|
.font(.caption2)
|
||||||
.foregroundColor(.secondary)
|
.bold()
|
||||||
|
.foregroundColor(.secondary)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
|
@ -60,10 +60,12 @@ struct UnreadWidgetView : View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
HStack {
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
Text(L10n.unreadCount(entry.widgetData.currentUnreadCount - maxCount()))
|
if entry.widgetData.currentUnreadCount - maxCount() > 0 {
|
||||||
.font(.caption2)
|
Text(L10n.unreadCount(entry.widgetData.currentUnreadCount - maxCount()))
|
||||||
.bold()
|
.font(.caption2)
|
||||||
.foregroundColor(.secondary)
|
.bold()
|
||||||
|
.foregroundColor(.secondary)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user