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,10 +65,14 @@ struct RecentsView: View {
|
|||||||
.disabled(historyCount == hostsManager.history.count)
|
.disabled(historyCount == hostsManager.history.count)
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
Text("\(historyCount)/\(hostsManager.history.count)")
|
Text(
|
||||||
.foregroundStyle(.gray)
|
historyCount == 0 ?
|
||||||
.font(.caption)
|
"\(hostsManager.history.count) item\(plural(hostsManager.history.count))" :
|
||||||
.contentTransition(.numericText())
|
"\(historyCount)/\(hostsManager.history.count)"
|
||||||
|
)
|
||||||
|
.foregroundStyle(.gray)
|
||||||
|
.font(.caption)
|
||||||
|
.contentTransition(.numericText())
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@@ -96,3 +100,7 @@ struct RecentsView: View {
|
|||||||
keyManager: KeyManager()
|
keyManager: KeyManager()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func plural(_ num: Int) -> String {
|
||||||
|
return num == 1 ? "" : "s"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user