more work on album filters

This commit is contained in:
Drew Weymouth
2023-05-11 16:45:47 -07:00
parent b2dce99714
commit 87ae111cb2
10 changed files with 250 additions and 206 deletions
+3 -3
View File
@@ -113,8 +113,8 @@ func (s *SettingsDialog) createGeneralTab() *container.TabItem {
// Scrobble settings
twoDigitValidator := func(text string, r rune) bool {
return unicode.IsDigit(r) && len(text) < 2
twoDigitValidator := func(text, selText string, r rune) bool {
return unicode.IsDigit(r) && len(text)-len(selText) < 2
}
percentEntry := widgets.NewTextRestrictedEntry(twoDigitValidator)
@@ -247,7 +247,7 @@ func (s *SettingsDialog) createPlaybackTab() *container.TabItem {
replayGainSelect.SetSelectedIndex(0)
}
preampGain := widgets.NewTextRestrictedEntry(func(curText string, r rune) bool {
preampGain := widgets.NewTextRestrictedEntry(func(curText, _ string, r rune) bool {
return (curText == "" && r == '-') ||
(curText == "" && unicode.IsDigit(r)) ||
((curText == "-" || curText == "0") && unicode.IsDigit(r))