Move towards selection section inventory management

This commit is contained in:
2023-02-14 23:25:09 +00:00
parent 9dd4c53316
commit ff5fa6321a
6 changed files with 252 additions and 66 deletions
+7 -13
View File
@@ -30,19 +30,14 @@ data SelectionList a = SelectionList
}
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
data Regex = NoRegex
| Regex
{ _regString :: String
, _regInput :: Bool
}
data SelectionSections a = SelectionSections
{ _sssSections :: IntMap (SelectionSection a)
, _sssSelPos :: Maybe Int
}
data SectionCursor = SectionCursor
{ _scurPos :: Int
{ _scurSel :: Int
, _scurPos :: Int
, _scurSize :: Int
, _scurColor :: Color
}
@@ -50,6 +45,7 @@ data SectionCursor = SectionCursor
data SelectionSection a = SelectionSection
{ _ssItems :: IntMap (SelectionItem a)
, _ssCursor :: Maybe SectionCursor
, _ssRegex :: Regex
-- , _ssSelPos :: Maybe Int
-- , _ssSelSize :: Maybe Int
-- , _ssSelColor :: Maybe Color
@@ -61,11 +57,10 @@ data SelectionSection a = SelectionSection
, _ssDescriptor :: String
}
data SMRegex = NoSMRegex
| SMRegex
{ _smrString :: String
, _smrInput :: Bool
}
data Regex = UnavailableRegex
| EmptyRegex
| Regex {_regexString :: String}
deriving (Show)
data SelectionIntMap a = SelectionIntMap
@@ -115,6 +110,5 @@ makeLenses ''SelectionSection
makeLenses ''SelectionSections
makeLenses ''SectionCursor
makeLenses ''Regex
makeLenses ''SMRegex
--deriveJSON defaultOptions ''SelectionItem
--deriveJSON defaultOptions ''SelectionList