mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
updated ui for recents when fully collapsed: instead of 0/10 its 10 items
This commit is contained in:
@@ -65,7 +65,11 @@ struct RecentsView: View {
|
||||
.disabled(historyCount == hostsManager.history.count)
|
||||
|
||||
Spacer()
|
||||
Text("\(historyCount)/\(hostsManager.history.count)")
|
||||
Text(
|
||||
historyCount == 0 ?
|
||||
"\(hostsManager.history.count) item\(plural(hostsManager.history.count))" :
|
||||
"\(historyCount)/\(hostsManager.history.count)"
|
||||
)
|
||||
.foregroundStyle(.gray)
|
||||
.font(.caption)
|
||||
.contentTransition(.numericText())
|
||||
@@ -96,3 +100,7 @@ struct RecentsView: View {
|
||||
keyManager: KeyManager()
|
||||
)
|
||||
}
|
||||
|
||||
func plural(_ num: Int) -> String {
|
||||
return num == 1 ? "" : "s"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user