Commit 0f5a7df 1 parent 9d617d3 commit 0f5a7df Copy full SHA for 0f5a7df
File tree 5 files changed +46
-9
lines changed
5 files changed +46
-9
lines changed Original file line number Diff line number Diff line change @@ -74,12 +74,12 @@ struct DataLink: Identifiable {
74
74
75
75
extension DataLink {
76
76
static var dataLinks = [
77
- DataLink ( title: " Github " , imageName: " " , children: [
78
- DataLink ( title: " 开发/仓库 " , imageName: " p5 " ) ,
79
- ] ) ,
80
77
DataLink ( title: " 资料 " , imageName: " " , children: [
81
78
DataLink ( title: " 资料整理 " , imageName: " p11 " )
82
79
] ) ,
80
+ DataLink ( title: " Github " , imageName: " " , children: [
81
+ DataLink ( title: " 开发/仓库 " , imageName: " p5 " ) ,
82
+ ] ) ,
83
83
DataLink ( title: " Swift指南 " , imageName: " " , children: [
84
84
DataLink ( title: " 语法速查 " , imageName: " p23 " ) ,
85
85
DataLink ( title: " 特性 " , imageName: " p10 " ) ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ struct EditCustomSearchView: View {
12
12
13
13
var body : some View {
14
14
VStack {
15
- Text ( " 自定义的搜索关键字,以换行作为间隔 " )
15
+ Text ( " 自定检索,换行间隔,同行逗号间隔 " )
16
16
TextEditor ( text: $term)
17
17
. overlay {
18
18
Rectangle ( )
Original file line number Diff line number Diff line change @@ -206,6 +206,13 @@ struct EditInfoView: View {
206
206
} label: {
207
207
Label ( " 设为封面图 " , image: " doc.text.image " )
208
208
}
209
+ Button {
210
+ let p = NSPasteboard . general
211
+ p. declareTypes ( [ . string] , owner: nil )
212
+ p. setString ( img. url, forType: . string)
213
+ } label: {
214
+ Label ( " 复制图片链接 " , image: " circle " )
215
+ }
209
216
Button {
210
217
info. imgs? . remove ( at: i)
211
218
IOImg . delete ( img)
@@ -229,6 +236,13 @@ struct EditInfoView: View {
229
236
} label: {
230
237
Label ( " 设为封面图 " , image: " doc.text.image " )
231
238
}
239
+ Button {
240
+ let p = NSPasteboard . general
241
+ p. declareTypes ( [ . string] , owner: nil )
242
+ p. setString ( img, forType: . string)
243
+ } label: {
244
+ Label ( " 复制图片链接 " , image: " circle " )
245
+ }
232
246
}
233
247
}
234
248
}
Original file line number Diff line number Diff line change @@ -117,9 +117,18 @@ struct InfoListView: View {
117
117
searchTerms = [ String] ( )
118
118
for t in terms {
119
119
if t. isEmpty == false {
120
- searchTerms. append ( String ( t) )
121
- }
122
- }
120
+ let tWithoutWhitespaces = t. trimmingCharacters ( in: . whitespaces)
121
+ if tWithoutWhitespaces. hasPrefix ( " // " ) { continue }
122
+ let ts = t. trimmingCharacters ( in: . whitespaces) . split ( separator: " , " )
123
+ if ts. count > 1 {
124
+ for oneT in ts {
125
+ searchTerms. append ( String ( oneT. trimmingCharacters ( in: . whitespaces) ) )
126
+ }
127
+ } else {
128
+ searchTerms. append ( String ( tWithoutWhitespaces) )
129
+ }
130
+ } // end if
131
+ } // end for
123
132
}
124
133
func customSearchLabel( _ string: String ) -> String {
125
134
let strs = string. split ( separator: " / " )
Original file line number Diff line number Diff line change @@ -35,8 +35,14 @@ struct InfoRowView: View {
35
35
}
36
36
37
37
}
38
- Text ( info. name)
39
- . fixedSize ( horizontal: false , vertical: true )
38
+ VStack ( alignment: . leading) {
39
+ Text ( info. name)
40
+ . fixedSize ( horizontal: false , vertical: true )
41
+ Text ( shortDes ( ) )
42
+ . fixedSize ( horizontal: false , vertical: true )
43
+ . font ( . footnote)
44
+ . foregroundColor ( light: . secondary, dark: . secondary)
45
+ }
40
46
}
41
47
42
48
@@ -82,6 +88,14 @@ struct InfoRowView: View {
82
88
}
83
89
}
84
90
91
+ func shortDes( ) -> String {
92
+ let shortDes = info. des. trimmingCharacters ( in: . whitespacesAndNewlines) . split ( separator: " \n " )
93
+ if let re = shortDes. first {
94
+ return String ( re)
95
+ }
96
+ return " "
97
+ }
98
+
85
99
}
86
100
87
101
You can’t perform that action at this time.
0 commit comments