mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
fix search
nice overlayed picker gotta clean up tho and gotta fix slow dl view
This commit is contained in:
3 files changed
+14
-8
No files matched your search
@@ -131,7 +131,8 @@ class EmojiHoarder: Hoarder, ObservableObject {
|
||||
func buildTrie() {
|
||||
let start = Date().timeIntervalSince1970
|
||||
for emoji in emojis {
|
||||
// trie.insewrt(word: emoji.name)
|
||||
// trie.insert(word: emoji.name)
|
||||
trie.wordlist.insert(emoji.name)
|
||||
trie.dict[emoji.name] = emoji
|
||||
}
|
||||
buildDownloadedEmojis()
|
||||
|
||||
@@ -14,12 +14,7 @@ struct BrowseView: View {
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
Picker("", selection: $browseWhat) {
|
||||
ForEach(StickerType.allCases) { type in
|
||||
Text(type.description).tag(type)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
Group {
|
||||
switch browseWhat {
|
||||
case .slackEmoji:
|
||||
EmojiCollectionView(
|
||||
@@ -37,6 +32,16 @@ struct BrowseView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.overlay(alignment: .top) {
|
||||
Picker("", selection: $browseWhat) {
|
||||
ForEach(StickerType.allCases) { type in
|
||||
Text(type.description).tag(type)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
.padding(.horizontal)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ struct DownloadedView: View {
|
||||
let columns: Int = max(1, Int((geo.size.width - 2*spacing) / (minColWidth + spacing)))
|
||||
let layout = Array(repeating: col, count: columns)
|
||||
LazyVGrid(columns: layout, spacing: spacing) {
|
||||
ForEach(emojiHoarder.downloadedStickers.sorted(), id: \.self) { name in
|
||||
ForEach(Array(emojiHoarder.downloadedStickers), id: \.self) { name in
|
||||
if let emoji = emojiHoarder.trie.dict[name] {
|
||||
ZStack {
|
||||
Rectangle()
|
||||
|
||||