Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Draggable container for a single item. Useful for adding drag support without
having to implement a custom widget. Usually works in tandem with
DropTarget
.
The regular styling of this component apply only when the item is not being dragged. To style the dragged container, use draggableStyle.
The transparency config only applies to the inner content.
Config:
- transparency: the alpha level to apply when rendering content in drag mode.
- maxDim: the maximum size of the largest axis when dragging. Keeps proportions.
- draggableStyle: the style to use when the item is being dragged.
- draggableRender: rendering function for the dragged state. Allows customizing this step without implementing a custom widget all the lifecycle steps.
Synopsis
- draggable :: DragMsg a => a -> WidgetNode s e -> WidgetNode s e
- draggable_ :: DragMsg a => a -> [DraggableCfg s e] -> WidgetNode s e -> WidgetNode s e
- draggableMaxDim :: Double -> DraggableCfg s e
- draggableStyle :: [StyleState] -> DraggableCfg s e
- draggableRender :: DraggableRender s e -> DraggableCfg s e
Documentation
draggable :: DragMsg a => a -> WidgetNode s e -> WidgetNode s e Source #
Creates a draggable container with a single node as child.
draggable_ :: DragMsg a => a -> [DraggableCfg s e] -> WidgetNode s e -> WidgetNode s e Source #
Creates a draggable container with a single node as child. Accepts config.
draggableMaxDim :: Double -> DraggableCfg s e Source #
Maximum dimension. Useful when aspect ratio needs to be maintained while at the same time restricting growth.
draggableStyle :: [StyleState] -> DraggableCfg s e Source #
The style of the dragged container.
draggableRender :: DraggableRender s e -> DraggableCfg s e Source #
Rendering function for the dragged state.