Consolidate shared UI, hardware transport, and translation tooling

This commit is contained in:
Storm Dragon committed 2026-11-16 20:07:56 -05:00
1 parent ed6951f4cd
commit 2c612de63b
61 files changed
+2417 -1573

No files matched your search

+8 -8
View File
@@ -9,25 +9,25 @@ import "git.stormux.org/storm/screenreader-common/quicksettings"
// as "Default". Profile names are visible text, so this ID cannot collide.
const QuickSavedChoice = "\x00saved"
// Quick_choice names the profile matching current, then QuickSavedChoice when
// QuickChoice names the profile matching current, then QuickSavedChoice when
// current is the saved voice, and otherwise "" for a voice changed this session.
// saved is the voice the reader would use without session changes, such as the
// focused application's saved voice; nil when unknown.
func (c Collection) Quick_choice(current Profile, saved *Profile) string {
func (c Collection) QuickChoice(current Profile, saved *Profile) string {
if name := c.Matching(current); name != "" {
return name
}
if saved != nil && Same_voice(*saved, current) {
if saved != nil && SameVoice(*saved, current) {
return QuickSavedChoice
}
return ""
}
// Quick_options lists "Custom" only while current matches no saved voice, then
// QuickOptions lists "Custom" only while current matches no saved voice, then
// "Default" for the saved voice, then each profile by name.
func (c Collection) Quick_options(current Profile, saved *Profile) []quicksettings.Option {
func (c Collection) QuickOptions(current Profile, saved *Profile) []quicksettings.Option {
options := []quicksettings.Option{}
if c.Quick_choice(current, saved) == "" {
if c.QuickChoice(current, saved) == "" {
options = append(options, quicksettings.Option{ID: "", Label: "Custom"})
}
if saved != nil {
@@ -39,8 +39,8 @@ func (c Collection) Quick_options(current Profile, saved *Profile) []quicksettin
return options
}
// Quick_profile returns the voice a quick settings choice selects.
func (c Collection) Quick_profile(choice string, saved *Profile) (Profile, bool) {
// QuickProfile returns the voice a quick settings choice selects.
func (c Collection) QuickProfile(choice string, saved *Profile) (Profile, bool) {
if choice == QuickSavedChoice {
if saved == nil {
return Profile{}, false