module Hoodle.Type.Widget where
import Control.Lens (Simple,Lens,lens)
import Hoodle.Type.PageArrangement
data CanvasWidgets =
CanvasWidgets { _testWidgetPosition :: CanvasCoordinate
, _widgetConfig :: WidgetConfig
}
testWidgetPosition :: Simple Lens CanvasWidgets CanvasCoordinate
testWidgetPosition = lens _testWidgetPosition (\f a -> f { _testWidgetPosition = a} )
defaultCanvasWidgets :: CanvasWidgets
defaultCanvasWidgets =
CanvasWidgets
{ _testWidgetPosition = CvsCoord (100,100)
, _widgetConfig = defaultWidgetConfig
}
data WidgetConfig = WidgetConfig { _doesUsePanZoom :: Bool }
doesUsePanZoom :: Simple Lens WidgetConfig Bool
doesUsePanZoom = lens _doesUsePanZoom (\f a -> f {_doesUsePanZoom = a})
defaultWidgetConfig :: WidgetConfig
defaultWidgetConfig = WidgetConfig { _doesUsePanZoom = True }
widgetConfig :: Simple Lens CanvasWidgets WidgetConfig
widgetConfig = lens _widgetConfig (\f a -> f { _widgetConfig =a } )