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 |
A view switcher action bar.
An action bar letting you switch between multiple views offered by a
Stack
, via an [classviewSwitcher
]. It is designed to be put at
the bottom of a window and to be revealed only on really narrow windows e.g.
on mobile phones. It can't be revealed if there are less than two pages.
HdyViewSwitcherBar
is intended to be used together with
[classviewSwitcherTitle
].
A common use case is to bind the [propertyviewSwitcherBar
:reveal] property
to [propertyviewSwitcherTitle
:title-visible] to automatically reveal the
view switcher bar when the title label is displayed in place of the view
switcher, as follows:
xml code
<object class="GtkWindow"/> <child type="titlebar"> <object class="HdyHeaderBar"> <property name="centering-policy">strict</property> <child type="title"> <object class="HdyViewSwitcherTitle" id="view_switcher_title"> <property name="stack">stack</property> </object> </child> </object> </child> <child> <object class="GtkBox"> <child> <object class="GtkStack" id="stack"/> </child> <child> <object class="HdyViewSwitcherBar"> <property name="stack">stack</property> <property name="reveal" bind-source="view_switcher_title" bind-property="title-visible" bind-flags="sync-create"/> </object> </child> </object> </child> </object>
CSS nodes
HdyViewSwitcherBar
has a single CSS node with name viewswitcherbar
.
Since: 1.0
Synopsis
- newtype ViewSwitcherBar = ViewSwitcherBar (ManagedPtr ViewSwitcherBar)
- class (GObject o, IsDescendantOf ViewSwitcherBar o) => IsViewSwitcherBar o
- toViewSwitcherBar :: (MonadIO m, IsViewSwitcherBar o) => o -> m ViewSwitcherBar
- viewSwitcherBarGetPolicy :: (HasCallStack, MonadIO m, IsViewSwitcherBar a) => a -> m ViewSwitcherPolicy
- viewSwitcherBarGetReveal :: (HasCallStack, MonadIO m, IsViewSwitcherBar a) => a -> m Bool
- viewSwitcherBarGetStack :: (HasCallStack, MonadIO m, IsViewSwitcherBar a) => a -> m (Maybe Stack)
- viewSwitcherBarNew :: (HasCallStack, MonadIO m) => m ViewSwitcherBar
- viewSwitcherBarSetPolicy :: (HasCallStack, MonadIO m, IsViewSwitcherBar a) => a -> ViewSwitcherPolicy -> m ()
- viewSwitcherBarSetReveal :: (HasCallStack, MonadIO m, IsViewSwitcherBar a) => a -> Bool -> m ()
- viewSwitcherBarSetStack :: (HasCallStack, MonadIO m, IsViewSwitcherBar a, IsStack b) => a -> Maybe b -> m ()
- constructViewSwitcherBarPolicy :: (IsViewSwitcherBar o, MonadIO m) => ViewSwitcherPolicy -> m (GValueConstruct o)
- getViewSwitcherBarPolicy :: (MonadIO m, IsViewSwitcherBar o) => o -> m ViewSwitcherPolicy
- setViewSwitcherBarPolicy :: (MonadIO m, IsViewSwitcherBar o) => o -> ViewSwitcherPolicy -> m ()
- constructViewSwitcherBarReveal :: (IsViewSwitcherBar o, MonadIO m) => Bool -> m (GValueConstruct o)
- getViewSwitcherBarReveal :: (MonadIO m, IsViewSwitcherBar o) => o -> m Bool
- setViewSwitcherBarReveal :: (MonadIO m, IsViewSwitcherBar o) => o -> Bool -> m ()
- clearViewSwitcherBarStack :: (MonadIO m, IsViewSwitcherBar o) => o -> m ()
- constructViewSwitcherBarStack :: (IsViewSwitcherBar o, MonadIO m, IsStack a) => a -> m (GValueConstruct o)
- getViewSwitcherBarStack :: (MonadIO m, IsViewSwitcherBar o) => o -> m (Maybe Stack)
- setViewSwitcherBarStack :: (MonadIO m, IsViewSwitcherBar o, IsStack a) => o -> a -> m ()
Exported types
newtype ViewSwitcherBar Source #
Memory-managed wrapper type.
ViewSwitcherBar (ManagedPtr ViewSwitcherBar) |
Instances
class (GObject o, IsDescendantOf ViewSwitcherBar o) => IsViewSwitcherBar o Source #
Type class for types which can be safely cast to ViewSwitcherBar
, for instance with toViewSwitcherBar
.
Instances
(GObject o, IsDescendantOf ViewSwitcherBar o) => IsViewSwitcherBar o Source # | |
Defined in GI.Handy.Objects.ViewSwitcherBar |
toViewSwitcherBar :: (MonadIO m, IsViewSwitcherBar o) => o -> m ViewSwitcherBar Source #
Cast to ViewSwitcherBar
, 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, getNoShowAll, getOpacity, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPolicy, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizeMode, getReveal, 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, setNoShowAll, setOpacity, setParent, setParentWindow, setPolicy, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setReveal, setSensitive, setSizeRequest, setStack, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.
getPolicy
viewSwitcherBarGetPolicy Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherBar a) | |
=> a |
|
-> m ViewSwitcherPolicy | Returns: the policy of |
Gets the policy of self
.
Since: 1.0
getReveal
viewSwitcherBarGetReveal Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherBar a) | |
=> a |
|
-> m Bool | Returns: whether |
Gets whether self
should be revealed or hidden.
Since: 1.0
getStack
viewSwitcherBarGetStack Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherBar a) | |
=> a |
|
-> m (Maybe Stack) | Returns: the stack |
Get the Stack
being controlled by the [classviewSwitcher
].
Since: 1.0
new
:: (HasCallStack, MonadIO m) | |
=> m ViewSwitcherBar | Returns: the newly created |
Creates a new HdyViewSwitcherBar
.
Since: 1.0
setPolicy
viewSwitcherBarSetPolicy Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherBar a) | |
=> a |
|
-> ViewSwitcherPolicy |
|
-> m () |
Sets the policy of self
.
Since: 1.0
setReveal
viewSwitcherBarSetReveal Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherBar a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether self
should be revealed or not.
Since: 1.0
setStack
viewSwitcherBarSetStack Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherBar a, IsStack b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the Stack
to control.
Since: 1.0
Properties
policy
The policy used to determine which mode to use.
Since: 1.0
constructViewSwitcherBarPolicy :: (IsViewSwitcherBar 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
.
getViewSwitcherBarPolicy :: (MonadIO m, IsViewSwitcherBar o) => o -> m ViewSwitcherPolicy Source #
Get the value of the “policy
” property.
When overloading is enabled, this is equivalent to
get
viewSwitcherBar #policy
setViewSwitcherBarPolicy :: (MonadIO m, IsViewSwitcherBar o) => o -> ViewSwitcherPolicy -> m () Source #
Set the value of the “policy
” property.
When overloading is enabled, this is equivalent to
set
viewSwitcherBar [ #policy:=
value ]
reveal
Whether the bar should be revealed or hidden.
Since: 1.0
constructViewSwitcherBarReveal :: (IsViewSwitcherBar o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “reveal
” property. This is rarely needed directly, but it is used by new
.
getViewSwitcherBarReveal :: (MonadIO m, IsViewSwitcherBar o) => o -> m Bool Source #
Get the value of the “reveal
” property.
When overloading is enabled, this is equivalent to
get
viewSwitcherBar #reveal
setViewSwitcherBarReveal :: (MonadIO m, IsViewSwitcherBar o) => o -> Bool -> m () Source #
Set the value of the “reveal
” property.
When overloading is enabled, this is equivalent to
set
viewSwitcherBar [ #reveal:=
value ]
stack
The Stack
the [classviewSwitcher
] controls.
Since: 1.0
clearViewSwitcherBarStack :: (MonadIO m, IsViewSwitcherBar o) => o -> m () Source #
Set the value of the “stack
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#stack
constructViewSwitcherBarStack :: (IsViewSwitcherBar 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
.
getViewSwitcherBarStack :: (MonadIO m, IsViewSwitcherBar o) => o -> m (Maybe Stack) Source #
Get the value of the “stack
” property.
When overloading is enabled, this is equivalent to
get
viewSwitcherBar #stack
setViewSwitcherBarStack :: (MonadIO m, IsViewSwitcherBar o, IsStack a) => o -> a -> m () Source #
Set the value of the “stack
” property.
When overloading is enabled, this is equivalent to
set
viewSwitcherBar [ #stack:=
value ]