Files
screenreader-common/emoji/picker.go
T

24 lines
814 B
Go

// Copyright (c) 2026 Storm Dragon
// SPDX-License-Identifier: GPL-3.0-or-later
package emoji
import "sort"
// PickerColumns is the grid width both readers' pickers use.
const PickerColumns = 6
// PickerTabs returns the picker's tabs in order: an "all" tab with every
// entry sorted by label, then one tab per category in catalog order. Each
// reader builds its own grid control from these, since control IDs, actions,
// label translation and extra controls are reader decisions.
func PickerTabs() []Category {
categories := Categories()
var all []Entry
for _, category := range categories {
all = append(all, category.Entries...)
}
sort.SliceStable(all, func(i, j int) bool { return all[i].Label < all[j].Label })
return append([]Category{{ID: "all", Label: "All", Entries: all}}, categories...)
}