Start adding filters to selection lists
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user