Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
An interface for swipeable widgets.
The AdwSwipeable
interface is implemented by all swipeable widgets.
See [classswipeTracker
] for details about implementing it.
Synopsis
- newtype Swipeable = Swipeable (ManagedPtr Swipeable)
- class (GObject o, IsDescendantOf Swipeable o) => IsSwipeable o
- toSwipeable :: (MonadIO m, IsSwipeable o) => o -> m Swipeable
- swipeableGetCancelProgress :: (HasCallStack, MonadIO m, IsSwipeable a) => a -> m Double
- swipeableGetDistance :: (HasCallStack, MonadIO m, IsSwipeable a) => a -> m Double
- swipeableGetProgress :: (HasCallStack, MonadIO m, IsSwipeable a) => a -> m Double
- swipeableGetSnapPoints :: (HasCallStack, MonadIO m, IsSwipeable a) => a -> m [Double]
- swipeableGetSwipeArea :: (HasCallStack, MonadIO m, IsSwipeable a) => a -> NavigationDirection -> Bool -> m Rectangle
Exported types
Memory-managed wrapper type.
Instances
Eq Swipeable Source # | |
GObject Swipeable Source # | |
Defined in GI.Adw.Interfaces.Swipeable | |
ManagedPtrNewtype Swipeable Source # | |
Defined in GI.Adw.Interfaces.Swipeable toManagedPtr :: Swipeable -> ManagedPtr Swipeable | |
TypedObject Swipeable Source # | |
Defined in GI.Adw.Interfaces.Swipeable | |
HasParentTypes Swipeable Source # | |
Defined in GI.Adw.Interfaces.Swipeable | |
IsGValue (Maybe Swipeable) Source # | Convert |
Defined in GI.Adw.Interfaces.Swipeable gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Swipeable -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Swipeable) | |
type ParentTypes Swipeable Source # | |
Defined in GI.Adw.Interfaces.Swipeable type ParentTypes Swipeable = '[Widget, Object] |
class (GObject o, IsDescendantOf Swipeable o) => IsSwipeable o Source #
Type class for types which can be safely cast to Swipeable
, for instance with toSwipeable
.
Instances
(GObject o, IsDescendantOf Swipeable o) => IsSwipeable o Source # | |
Defined in GI.Adw.Interfaces.Swipeable |
toSwipeable :: (MonadIO m, IsSwipeable o) => o -> m Swipeable Source #
Methods
Click to display all available methods, including inherited ones
Methods
actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBounds, getBuildableId, getCanFocus, getCanTarget, getCancelProgress, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getDistance, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProgress, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getSnapPoints, getStateFlags, getStyleContext, getSwipeArea, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.
Setters
setAccessibleParent, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.
getCancelProgress
swipeableGetCancelProgress Source #
:: (HasCallStack, MonadIO m, IsSwipeable a) | |
=> a |
|
-> m Double | Returns: the cancel progress, unitless |
Gets the progress self
will snap back to after the gesture is canceled.
getDistance
:: (HasCallStack, MonadIO m, IsSwipeable a) | |
=> a |
|
-> m Double | Returns: the swipe distance in pixels |
Gets the swipe distance of self
.
This corresponds to how many pixels 1 unit represents.
getProgress
:: (HasCallStack, MonadIO m, IsSwipeable a) | |
=> a |
|
-> m Double | Returns: the current progress, unitless |
Gets the current progress of self
.
getSnapPoints
swipeableGetSnapPoints Source #
:: (HasCallStack, MonadIO m, IsSwipeable a) | |
=> a |
|
-> m [Double] | Returns: the snap points |
Gets the snap points of self
.
Each snap point represents a progress value that is considered acceptable to end the swipe on.
getSwipeArea
swipeableGetSwipeArea Source #
:: (HasCallStack, MonadIO m, IsSwipeable a) | |
=> a |
|
-> NavigationDirection |
|
-> Bool |
|
-> m Rectangle |
Gets the area self
can start a swipe from for the given direction and
gesture type.
This can be used to restrict swipes to only be possible from a certain area, for example, to only allow edge swipes, or to have a draggable element and ignore swipes elsewhere.
If not implemented, the default implementation returns the allocation of
self
, allowing swipes from anywhere.