Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename Side Bar Selected Symbol Field

  • Loading branch information...
commit cfed2ec0a74c33c2025e0a2036575aa97dc424a9 1 parent 4f6f267
@btmura authored
View
4 src/B1/Program/Chart/Screen.hs
@@ -62,7 +62,7 @@ drawScreen resources = do
{ S.bounds = zeroBox
, S.newSymbols = symbols config
-- , S.newMiniChartDraggedIn = Nothing
- , S.justSelectedSymbol = selectedSymbol config
+ , S.selectedSymbol = selectedSymbol config
, S.refreshRequested = False
, S.inputState = S.newSideBarState
}
@@ -145,7 +145,7 @@ drawScreenLoop
let nextSideBarInput = sideBarInput
{ S.newSymbols = maybeToList $ F.buttonClickedSymbol frameOutput
-- , S.newMiniChartDraggedIn = Nothing
- , S.justSelectedSymbol = F.selectedSymbol frameOutput
+ , S.selectedSymbol = F.selectedSymbol frameOutput
, S.refreshRequested = isJust $ F.refreshedSymbol frameOutput
, S.inputState = S.outputState sideBarOutput
}
View
14 src/B1/Program/Chart/SideBar.hs
@@ -50,7 +50,7 @@ draggedOutScaleAnimation = animateOnce $ linearRange 0 0 20
data SideBarInput = SideBarInput
{ bounds :: Box
, newSymbols :: [Symbol]
- , justSelectedSymbol :: Maybe Symbol
+ , selectedSymbol :: Maybe Symbol
, refreshRequested :: Bool
, inputState :: SideBarState
}
@@ -92,7 +92,7 @@ drawSideBar resources
SideBarInput
{ bounds = bounds
, newSymbols = newSymbols
- , justSelectedSymbol = justSelectedSymbol
+ , selectedSymbol = selectedSymbol
, refreshRequested = refreshRequested
, inputState = inputState
} = do
@@ -101,7 +101,7 @@ drawSideBar resources
(drawSlots resources bounds refreshRequested
. addDraggingScrollAmount resources bounds
- . calculateNextScrollAmount resources bounds justSelectedSymbol
+ . calculateNextScrollAmount resources bounds selectedSymbol
. reorderSlotsBeingDragged resources bounds
. markSlotsBeingDragged resources bounds
. insertDraggedInSlot resources bounds Nothing
@@ -210,7 +210,7 @@ createDraggedInSlot draggedInChart =
calculateNextScrollAmount :: Resources -> Box -> Maybe Symbol
-> SideBarState -> SideBarState
-calculateNextScrollAmount resources bounds justSelectedSymbol
+calculateNextScrollAmount resources bounds selectedSymbol
state@SideBarState
{ scrollAmount = scrollAmount
, slots = slots
@@ -225,12 +225,12 @@ calculateNextScrollAmount resources bounds justSelectedSymbol
allShowing = areAllSlotsShowing bounds slots
addedNewSlots = length newSlots > 0
- needScrollToSelected = isJust justSelectedSymbol
- && any (containsSymbol (fromJust justSelectedSymbol)) slots
+ needScrollToSelected = isJust selectedSymbol
+ && any (containsSymbol (fromJust selectedSymbol)) slots
&& not (boxContainsBox bounds selectedBounds)
selectedIndex = (fst . head
- . filter (containsSymbol (fromJust justSelectedSymbol) . snd)) $
+ . filter (containsSymbol (fromJust selectedSymbol) . snd)) $
zip [0..] slots
selectedBounds = getSlotBounds bounds scrollAmount slots selectedIndex
selectedScrollAmount
Please sign in to comment.
Something went wrong with that request. Please try again.