From 4ff0a25096a83f6cfae661472b7af35ed4f2c184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=B4=E9=93=AD?= Date: Mon, 15 Apr 2024 10:41:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InfoOrganizer/Category/CategoryRowView.swift | 2 +- SwiftPamphletApp/InfoOrganizer/Info/InfoRowView.swift | 10 +++++++--- SwiftPamphletApp/ViewComponet/ViewComponentImage.swift | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/SwiftPamphletApp/InfoOrganizer/Category/CategoryRowView.swift b/SwiftPamphletApp/InfoOrganizer/Category/CategoryRowView.swift index 6f35a94f0..f482ca075 100644 --- a/SwiftPamphletApp/InfoOrganizer/Category/CategoryRowView.swift +++ b/SwiftPamphletApp/InfoOrganizer/Category/CategoryRowView.swift @@ -39,7 +39,7 @@ struct CategoryRowView: View { Button { IOCategory.pin(cate) } label: { - Label("置顶", systemImage: cate.pin == 1 ? "pin.slash.fill" : "pin.fill") + Label(cate.pin == 1 ? "取消置顶" : "置顶", systemImage: cate.pin == 1 ? "pin.slash.fill" : "pin.fill") } Button(role: .destructive) { IOCategory.delete(cate) diff --git a/SwiftPamphletApp/InfoOrganizer/Info/InfoRowView.swift b/SwiftPamphletApp/InfoOrganizer/Info/InfoRowView.swift index f393745a4..19a830c66 100644 --- a/SwiftPamphletApp/InfoOrganizer/Info/InfoRowView.swift +++ b/SwiftPamphletApp/InfoOrganizer/Info/InfoRowView.swift @@ -88,10 +88,14 @@ struct InfoRowView: View { func shortDes() -> String { let shortDes = info.des.trimmingCharacters(in: .whitespacesAndNewlines).components(separatedBy: .newlines) - if let re = shortDes.first { - return String(re) + var reStr = "" + if let first = shortDes.first { + reStr += first } - return "" + if shortDes.count > 1 { + reStr += "\n" + shortDes[1] + } + return reStr } } diff --git a/SwiftPamphletApp/ViewComponet/ViewComponentImage.swift b/SwiftPamphletApp/ViewComponet/ViewComponentImage.swift index bae761b58..4e303d255 100644 --- a/SwiftPamphletApp/ViewComponet/ViewComponentImage.swift +++ b/SwiftPamphletApp/ViewComponet/ViewComponentImage.swift @@ -32,7 +32,7 @@ struct NukeImage: View { } else if state.isLoading == false { ZStack { Color.gray.opacity(0.2) // Placeholder - Text(url) + Text(url.prefix(100)) .font(.footnote) .foregroundColor(light: .secondary, dark: .secondary) }