Permalink
Browse files

Rename Side Bar Selected Symbol Field

  • Loading branch information...
1 parent 4f6f267 commit cfed2ec0a74c33c2025e0a2036575aa97dc424a9 @btmura committed Jun 13, 2011
Showing with 9 additions and 9 deletions.
  1. +2 −2 src/B1/Program/Chart/Screen.hs
  2. +7 −7 src/B1/Program/Chart/SideBar.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
}
@@ -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

0 comments on commit cfed2ec

Please sign in to comment.