Commit de3a2400 authored by Guerric Chupin's avatar Guerric Chupin

Reinitialize note settings when changing layer.

parent c5440b2b
......@@ -144,7 +144,7 @@ createNotebook addLayerRV rmLayerRV layerMCBMVar guiCellMCBMVar = do
containerAdd nCenterBoard nGuiBoard
containerAdd nBoardCont nCenterBoard
newP <- notebookAppendPage n nBoardCont $ show np
notebookAppendPage n nBoardCont $ show np
pChan <- reactiveValueRead pageChanRV
let newCP = foundHole pChan
(nBoardRV, nPieceArrRV, nPhRV) <- initBoardRV nGuiBoard
......@@ -196,6 +196,16 @@ createNotebook addLayerRV rmLayerRV layerMCBMVar guiCellMCBMVar = do
putMVar layerHidMVar
return ()
oldCurChanRV <- newCBMVarRW =<< reactiveValueRead curChanRV
reactiveValueOnCanRead curChanRV $ do
oldC <- reactiveValueRead oldCurChanRV
newC <- reactiveValueRead curChanRV
when (oldC /= newC) $ do
reactiveValueWrite oldCurChanRV newC
tryTakeMVar guiCellHidMVar >>=
fromMaybeM_ . fmap (removeCallbackMCBMVar guiCellMCBMVar)
reactiveValueWrite guiCellMCBMVar inertCell
------------------------------------------------------------------------------
-- For good measure
------------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment