{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE RecursiveDo #-} module Potato.Flow.Vty.ToolOptions ( ToolOptionsWidgetConfig(..) , ToolOptionsWidget(..) , holdToolOptionsWidget ) where import Relude import Potato.Flow.Controller import Potato.Flow.Vty.Common import Potato.Reflex.Vty.Helpers import Control.Monad.Fix import Control.Monad.NodeId import Reflex data ToolOptionsWidgetConfig t = ToolOptionsWidgetConfig { forall t. ToolOptionsWidgetConfig t -> Dynamic t Tool _toolOptionsWidgetConfig_tool :: Dynamic t Tool , forall t. ToolOptionsWidgetConfig t -> Dynamic t Int _toolOptionsWidgetConfig_widthDyn :: Dynamic t Int } data ToolOptionsWidget t = ToolOptionsWidget { forall t. ToolOptionsWidget t -> Event t () _toolOptionsWidget_setOption :: Event t () , forall t. ToolOptionsWidget t -> Dynamic t Int _toolOptionsWidget_heightDyn :: Dynamic t Int } holdToolOptionsWidget :: forall t m. (PostBuild t m, MonadWidget t m) => ToolOptionsWidgetConfig t -> m (ToolOptionsWidget t) holdToolOptionsWidget :: forall t (m :: * -> *). (PostBuild t m, MonadWidget t m) => ToolOptionsWidgetConfig t -> m (ToolOptionsWidget t) holdToolOptionsWidget ToolOptionsWidgetConfig {Dynamic t Int Dynamic t Tool _toolOptionsWidgetConfig_widthDyn :: Dynamic t Int _toolOptionsWidgetConfig_tool :: Dynamic t Tool _toolOptionsWidgetConfig_widthDyn :: forall t. ToolOptionsWidgetConfig t -> Dynamic t Int _toolOptionsWidgetConfig_tool :: forall t. ToolOptionsWidgetConfig t -> Dynamic t Tool ..} = mdo forall (m :: * -> *) a. Monad m => a -> m a return ToolOptionsWidget { _toolOptionsWidget_setOption :: Event t () _toolOptionsWidget_setOption = forall {k} (t :: k) a. Reflex t => Event t a never , _toolOptionsWidget_heightDyn :: Dynamic t Int _toolOptionsWidget_heightDyn = forall {k} (t :: k) a. Reflex t => a -> Dynamic t a constDyn Int 0 }