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.
<picture> <source srcset="view-switcher-bar-dark.png" media="(prefers-color-scheme: dark)"> <img src="view-switcher-bar.png" alt="view-switcher-bar"> </picture>
An action bar letting you switch between multiple views contained in a
[classviewStack
], 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.
AdwViewSwitcherBar
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"> <property name="titlebar"> <object class="AdwHeaderBar"> <property name="centering-policy">strict</property> <property name="title-widget"> <object class="AdwViewSwitcherTitle" id="title"> <property name="stack">stack</property> </object> </property> </object> </property> <property> <object class="GtkBox"> <property name="orientation">vertical</property> <child> <object class="AdwViewStack" id="stack"/> </child> <child> <object class="AdwViewSwitcherBar"> <property name="stack">stack</property> <binding name="reveal"> <lookup name="title-visible">title</lookup> </binding> </object> </child> </object> </property> </object>
CSS nodes
AdwViewSwitcherBar
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
- viewSwitcherBarGetReveal :: (HasCallStack, MonadIO m, IsViewSwitcherBar a) => a -> m Bool
- viewSwitcherBarGetStack :: (HasCallStack, MonadIO m, IsViewSwitcherBar a) => a -> m (Maybe ViewStack)
- viewSwitcherBarNew :: (HasCallStack, MonadIO m) => m ViewSwitcherBar
- viewSwitcherBarSetReveal :: (HasCallStack, MonadIO m, IsViewSwitcherBar a) => a -> Bool -> m ()
- viewSwitcherBarSetStack :: (HasCallStack, MonadIO m, IsViewSwitcherBar a, IsViewStack b) => a -> Maybe b -> 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, IsViewStack a) => a -> m (GValueConstruct o)
- getViewSwitcherBarStack :: (MonadIO m, IsViewSwitcherBar o) => o -> m (Maybe ViewStack)
- setViewSwitcherBarStack :: (MonadIO m, IsViewSwitcherBar o, IsViewStack 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.Adw.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
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, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getReveal, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStack, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.
Setters
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, setReveal, setSensitive, setSizeRequest, setStack, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.
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 ViewStack) | Returns: the stack |
Gets the stack controlled by self
.
Since: 1.0
new
:: (HasCallStack, MonadIO m) | |
=> m ViewSwitcherBar | Returns: the newly created |
Creates a new AdwViewSwitcherBar
.
Since: 1.0
setReveal
viewSwitcherBarSetReveal Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherBar a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether self
should be revealed or hidden.
Since: 1.0
setStack
viewSwitcherBarSetStack Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherBar a, IsViewStack b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the stack controlled by self
.
Since: 1.0
Properties
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 view switcher 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, IsViewStack 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 ViewStack) Source #
Get the value of the “stack
” property.
When overloading is enabled, this is equivalent to
get
viewSwitcherBar #stack
setViewSwitcherBarStack :: (MonadIO m, IsViewSwitcherBar o, IsViewStack a) => o -> a -> m () Source #
Set the value of the “stack
” property.
When overloading is enabled, this is equivalent to
set
viewSwitcherBar [ #stack:=
value ]