monomer-1.0.0.0: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Monomer.Widgets.Containers.Draggable

Description

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

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.