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 adaptive view switcher.
An adaptive view switcher, designed to switch between multiple views in a
similar fashion than a StackSwitcher
.
Depending on the available width, the view switcher can adapt from a wide mode showing the view's icon and title side by side, to a narrow mode showing the view's icon and title one on top of the other, in a more compact way. This can be controlled via the policy property.
To look good in a header bar, an HdyViewSwitcher
requires to fill its full
height. Contrary to HeaderBar
, [classheaderBar
] doesn't force a
vertical alignment on its title widget, so we recommend it over
HeaderBar
.
CSS nodes
HdyViewSwitcher
has a single CSS node with name viewswitcher
.
Since: 1.0
Synopsis
- newtype ViewSwitcher = ViewSwitcher (ManagedPtr ViewSwitcher)
- class (GObject o, IsDescendantOf ViewSwitcher o) => IsViewSwitcher o
- toViewSwitcher :: (MonadIO m, IsViewSwitcher o) => o -> m ViewSwitcher
- viewSwitcherGetNarrowEllipsize :: (HasCallStack, MonadIO m, IsViewSwitcher a) => a -> m EllipsizeMode
- viewSwitcherGetPolicy :: (HasCallStack, MonadIO m, IsViewSwitcher a) => a -> m ViewSwitcherPolicy
- viewSwitcherGetStack :: (HasCallStack, MonadIO m, IsViewSwitcher a) => a -> m (Maybe Stack)
- viewSwitcherNew :: (HasCallStack, MonadIO m) => m ViewSwitcher
- viewSwitcherSetNarrowEllipsize :: (HasCallStack, MonadIO m, IsViewSwitcher a) => a -> EllipsizeMode -> m ()
- viewSwitcherSetPolicy :: (HasCallStack, MonadIO m, IsViewSwitcher a) => a -> ViewSwitcherPolicy -> m ()
- viewSwitcherSetStack :: (HasCallStack, MonadIO m, IsViewSwitcher a, IsStack b) => a -> Maybe b -> m ()
- constructViewSwitcherNarrowEllipsize :: (IsViewSwitcher o, MonadIO m) => EllipsizeMode -> m (GValueConstruct o)
- getViewSwitcherNarrowEllipsize :: (MonadIO m, IsViewSwitcher o) => o -> m EllipsizeMode
- setViewSwitcherNarrowEllipsize :: (MonadIO m, IsViewSwitcher o) => o -> EllipsizeMode -> m ()
- constructViewSwitcherPolicy :: (IsViewSwitcher o, MonadIO m) => ViewSwitcherPolicy -> m (GValueConstruct o)
- getViewSwitcherPolicy :: (MonadIO m, IsViewSwitcher o) => o -> m ViewSwitcherPolicy
- setViewSwitcherPolicy :: (MonadIO m, IsViewSwitcher o) => o -> ViewSwitcherPolicy -> m ()
- clearViewSwitcherStack :: (MonadIO m, IsViewSwitcher o) => o -> m ()
- constructViewSwitcherStack :: (IsViewSwitcher o, MonadIO m, IsStack a) => a -> m (GValueConstruct o)
- getViewSwitcherStack :: (MonadIO m, IsViewSwitcher o) => o -> m (Maybe Stack)
- setViewSwitcherStack :: (MonadIO m, IsViewSwitcher o, IsStack a) => o -> a -> m ()
Exported types
newtype ViewSwitcher Source #
Memory-managed wrapper type.
ViewSwitcher (ManagedPtr ViewSwitcher) |
Instances
Eq ViewSwitcher Source # | |
Defined in GI.Handy.Objects.ViewSwitcher (==) :: ViewSwitcher -> ViewSwitcher -> Bool # (/=) :: ViewSwitcher -> ViewSwitcher -> Bool # | |
GObject ViewSwitcher Source # | |
Defined in GI.Handy.Objects.ViewSwitcher | |
ManagedPtrNewtype ViewSwitcher Source # | |
Defined in GI.Handy.Objects.ViewSwitcher toManagedPtr :: ViewSwitcher -> ManagedPtr ViewSwitcher | |
TypedObject ViewSwitcher Source # | |
Defined in GI.Handy.Objects.ViewSwitcher | |
HasParentTypes ViewSwitcher Source # | |
Defined in GI.Handy.Objects.ViewSwitcher | |
IsGValue (Maybe ViewSwitcher) Source # | Convert |
Defined in GI.Handy.Objects.ViewSwitcher gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe ViewSwitcher -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe ViewSwitcher) | |
type ParentTypes ViewSwitcher Source # | |
Defined in GI.Handy.Objects.ViewSwitcher type ParentTypes ViewSwitcher = '[Bin, Container, Widget, Object, ImplementorIface, Buildable] |
class (GObject o, IsDescendantOf ViewSwitcher o) => IsViewSwitcher o Source #
Type class for types which can be safely cast to ViewSwitcher
, for instance with toViewSwitcher
.
Instances
(GObject o, IsDescendantOf ViewSwitcher o) => IsViewSwitcher o Source # | |
Defined in GI.Handy.Objects.ViewSwitcher |
toViewSwitcher :: (MonadIO m, IsViewSwitcher o) => o -> m ViewSwitcher Source #
Cast to ViewSwitcher
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
activate, add, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, propagateDraw, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, watchClosure.
Getters
getAccessible, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getBorderWidth, getCanDefault, getCanFocus, getChild, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getInternalChild, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getName, getNarrowEllipsize, getNoShowAll, getOpacity, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPolicy, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSizeRequest, getStack, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWindow.
Setters
setAccelPath, setAllocation, setAppPaintable, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNarrowEllipsize, setNoShowAll, setOpacity, setParent, setParentWindow, setPolicy, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSensitive, setSizeRequest, setStack, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.
getNarrowEllipsize
viewSwitcherGetNarrowEllipsize Source #
:: (HasCallStack, MonadIO m, IsViewSwitcher a) | |
=> a |
|
-> m EllipsizeMode | Returns: a |
Get the ellipsizing position of the narrow mode label.
Since: 1.0
getPolicy
viewSwitcherGetPolicy Source #
:: (HasCallStack, MonadIO m, IsViewSwitcher a) | |
=> a |
|
-> m ViewSwitcherPolicy | Returns: the policy of |
Gets the policy of self
.
Since: 1.0
getStack
:: (HasCallStack, MonadIO m, IsViewSwitcher a) | |
=> a |
|
-> m (Maybe Stack) | Returns: the stack |
Gets the stack controlled by self
.
Since: 1.0
new
:: (HasCallStack, MonadIO m) | |
=> m ViewSwitcher | Returns: the newly created |
Creates a new HdyViewSwitcher
.
Since: 1.0
setNarrowEllipsize
viewSwitcherSetNarrowEllipsize Source #
:: (HasCallStack, MonadIO m, IsViewSwitcher a) | |
=> a |
|
-> EllipsizeMode |
|
-> m () |
Sets the mode used to ellipsize the text in narrow mode.
Since: 1.0
setPolicy
viewSwitcherSetPolicy Source #
:: (HasCallStack, MonadIO m, IsViewSwitcher a) | |
=> a |
|
-> ViewSwitcherPolicy |
|
-> m () |
Sets the policy of self
.
Since: 1.0
setStack
:: (HasCallStack, MonadIO m, IsViewSwitcher a, IsStack b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the Stack
to control.
Since: 1.0
Properties
narrowEllipsize
The preferred place to ellipsize the string.
If the narrow mode label does not have enough room to display the entire
string, specified as a EllipsizeMode
.
Note that setting this property to a value other than
PANGO_ELLIPSIZE_NONE
has the side-effect that the label requests only
enough space to display the ellipsis.
Since: 1.0
constructViewSwitcherNarrowEllipsize :: (IsViewSwitcher o, MonadIO m) => EllipsizeMode -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “narrow-ellipsize
” property. This is rarely needed directly, but it is used by new
.
getViewSwitcherNarrowEllipsize :: (MonadIO m, IsViewSwitcher o) => o -> m EllipsizeMode Source #
Get the value of the “narrow-ellipsize
” property.
When overloading is enabled, this is equivalent to
get
viewSwitcher #narrowEllipsize
setViewSwitcherNarrowEllipsize :: (MonadIO m, IsViewSwitcher o) => o -> EllipsizeMode -> m () Source #
Set the value of the “narrow-ellipsize
” property.
When overloading is enabled, this is equivalent to
set
viewSwitcher [ #narrowEllipsize:=
value ]
policy
The policy to determine which mode to use.
Since: 1.0
constructViewSwitcherPolicy :: (IsViewSwitcher o, MonadIO m) => ViewSwitcherPolicy -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “policy
” property. This is rarely needed directly, but it is used by new
.
getViewSwitcherPolicy :: (MonadIO m, IsViewSwitcher o) => o -> m ViewSwitcherPolicy Source #
Get the value of the “policy
” property.
When overloading is enabled, this is equivalent to
get
viewSwitcher #policy
setViewSwitcherPolicy :: (MonadIO m, IsViewSwitcher o) => o -> ViewSwitcherPolicy -> m () Source #
Set the value of the “policy
” property.
When overloading is enabled, this is equivalent to
set
viewSwitcher [ #policy:=
value ]
stack
The Stack
the view switcher controls.
Since: 1.0
clearViewSwitcherStack :: (MonadIO m, IsViewSwitcher o) => o -> m () Source #
Set the value of the “stack
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#stack
constructViewSwitcherStack :: (IsViewSwitcher o, MonadIO m, IsStack a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “stack
” property. This is rarely needed directly, but it is used by new
.
getViewSwitcherStack :: (MonadIO m, IsViewSwitcher o) => o -> m (Maybe Stack) Source #
Get the value of the “stack
” property.
When overloading is enabled, this is equivalent to
get
viewSwitcher #stack
setViewSwitcherStack :: (MonadIO m, IsViewSwitcher o, IsStack a) => o -> a -> m () Source #
Set the value of the “stack
” property.
When overloading is enabled, this is equivalent to
set
viewSwitcher [ #stack:=
value ]