Start adding filters to selection lists

This commit is contained in:
2023-01-15 11:55:32 +00:00
parent 6f1162f7b9
commit 64b1c2761e
16 changed files with 128 additions and 66 deletions
+9
View File
@@ -2,6 +2,7 @@ module Dodge.SelectionList where
--import Color
--import Dodge.WindowLayout
import Regex
import Dodge.Data.Universe
import LensHelp
--import Data.Maybe
@@ -19,5 +20,13 @@ defaultSelectionList = SelectionList
{_slItems = []
, _slSelPos = Nothing
, _slLength = 0
, _slRegex = ""
, _slRegexInput = False
}
getShownItems :: SelectionList a -> [SelectionItem a]
getShownItems sl = case sl ^. slRegex of
"" -> _slItems sl
str -> SelectionFilter ["FILTER: "++str] : filter (doregex str) (_slItems sl)
where
doregex str = regexList str . _siPictures