Tweak inventory display
This commit is contained in:
@@ -296,10 +296,8 @@ updateSection indent mcsel sis availablelines oldoffset =
|
|||||||
SelectionSection
|
SelectionSection
|
||||||
{ _ssItems = sis
|
{ _ssItems = sis
|
||||||
, _ssOffset = offset
|
, _ssOffset = offset
|
||||||
, _ssShownItems =
|
, _ssShownItems = shownitems
|
||||||
tweakfirst . tweaklast . map (^. _2) $
|
, _ssShownLength = min aslength availablelines
|
||||||
take availablelines shownstrings
|
|
||||||
, _ssShownLength = length shownitems
|
|
||||||
, _ssIndent = indent
|
, _ssIndent = indent
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -196,12 +196,12 @@ selSecYint i j sss = do
|
|||||||
. fst
|
. fst
|
||||||
$ IM.split j (ss ^. ssItems)
|
$ IM.split j (ss ^. ssItems)
|
||||||
where
|
where
|
||||||
secpos = sum . fmap (length . _ssShownItems) . fst $ IM.split i sss
|
secpos = sum . fmap _ssShownLength . fst $ IM.split i sss
|
||||||
|
|
||||||
inverseSelSecYint :: Int -> IM.IntMap (SelectionSection a) -> Maybe (Int, Int)
|
inverseSelSecYint :: Int -> IM.IntMap (SelectionSection a) -> Maybe (Int, Int)
|
||||||
inverseSelSecYint yint sss = do
|
inverseSelSecYint yint sss = do
|
||||||
((i, ss), othersss) <- IM.minViewWithKey sss
|
((i, ss), othersss) <- IM.minViewWithKey sss
|
||||||
let l = length $ _ssShownItems ss
|
let l = _ssShownLength ss
|
||||||
if l <= yint
|
if l <= yint
|
||||||
then inverseSelSecYint (yint - l) othersss
|
then inverseSelSecYint (yint - l) othersss
|
||||||
else do
|
else do
|
||||||
|
|||||||
Reference in New Issue
Block a user