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 container for ViewSwitcher
.
AdwViewStack
is a container which only shows one page at a time.
It is typically used to hold an application's main views.
It doesn't provide a way to transition between pages.
Instead, a separate widget such as ViewSwitcher
can be used with
AdwViewStack
to provide this functionality.
AdwViewStack
pages can have a title, an icon, an attention request, and a
numbered badge that ViewSwitcher
will use to let users identify
which page is which.
Set them using the ViewStackPage:title,
ViewStackPage:iconName,
ViewStackPage:needsAttention, and
ViewStackPage:badgeNumber properties.
Transitions between views are animated by crossfading. These animations respect the Settings:gtkEnableAnimations setting.
AdwViewStack
maintains a ViewStackPage
object for each added
child, which holds additional per-child properties.
You obtain the ViewStackPage
for a child with
viewStackGetPage
and you can obtain a
SelectionModel
containing all the pages with
viewStackGetPages
.
AdwViewStack as GtkBuildable
To set child-specific properties in a .ui file, create
ViewStackPage
objects explicitly, and set the child widget as a
property on it:
xml code
<object class="AdwViewStack" id="stack"> <child> <object class="AdwViewStackPage"> <property name="name">overview</property> <property name="title">Overview</property> <property name="child"> <object class="AdwStatusPage"> <property name="title">Welcome!</property> </object> </property> </object> </child>
CSS nodes
AdwViewStack
has a single CSS node named stack
.
Since: 1.0
Synopsis
- newtype ViewStack = ViewStack (ManagedPtr ViewStack)
- class (GObject o, IsDescendantOf ViewStack o) => IsViewStack o
- toViewStack :: (MonadIO m, IsViewStack o) => o -> m ViewStack
- viewStackAdd :: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) => a -> b -> m ViewStackPage
- viewStackAddNamed :: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) => a -> b -> Maybe Text -> m ViewStackPage
- viewStackAddTitled :: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) => a -> b -> Maybe Text -> Text -> m ViewStackPage
- viewStackGetChildByName :: (HasCallStack, MonadIO m, IsViewStack a) => a -> Text -> m (Maybe Widget)
- viewStackGetHhomogeneous :: (HasCallStack, MonadIO m, IsViewStack a) => a -> m Bool
- viewStackGetInterpolateSize :: (HasCallStack, MonadIO m, IsViewStack a) => a -> m Bool
- viewStackGetPage :: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) => a -> b -> m ViewStackPage
- viewStackGetPages :: (HasCallStack, MonadIO m, IsViewStack a) => a -> m SelectionModel
- viewStackGetTransitionRunning :: (HasCallStack, MonadIO m, IsViewStack a) => a -> m Bool
- viewStackGetVhomogeneous :: (HasCallStack, MonadIO m, IsViewStack a) => a -> m Bool
- viewStackGetVisibleChild :: (HasCallStack, MonadIO m, IsViewStack a) => a -> m (Maybe Widget)
- viewStackGetVisibleChildName :: (HasCallStack, MonadIO m, IsViewStack a) => a -> m (Maybe Text)
- viewStackNew :: (HasCallStack, MonadIO m) => m ViewStack
- viewStackRemove :: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) => a -> b -> m ()
- viewStackSetHhomogeneous :: (HasCallStack, MonadIO m, IsViewStack a) => a -> Bool -> m ()
- viewStackSetInterpolateSize :: (HasCallStack, MonadIO m, IsViewStack a) => a -> Bool -> m ()
- viewStackSetVhomogeneous :: (HasCallStack, MonadIO m, IsViewStack a) => a -> Bool -> m ()
- viewStackSetVisibleChild :: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) => a -> b -> m ()
- viewStackSetVisibleChildName :: (HasCallStack, MonadIO m, IsViewStack a) => a -> Text -> m ()
- constructViewStackHhomogeneous :: (IsViewStack o, MonadIO m) => Bool -> m (GValueConstruct o)
- getViewStackHhomogeneous :: (MonadIO m, IsViewStack o) => o -> m Bool
- setViewStackHhomogeneous :: (MonadIO m, IsViewStack o) => o -> Bool -> m ()
- constructViewStackInterpolateSize :: (IsViewStack o, MonadIO m) => Bool -> m (GValueConstruct o)
- getViewStackInterpolateSize :: (MonadIO m, IsViewStack o) => o -> m Bool
- setViewStackInterpolateSize :: (MonadIO m, IsViewStack o) => o -> Bool -> m ()
- getViewStackPages :: (MonadIO m, IsViewStack o) => o -> m (Maybe SelectionModel)
- getViewStackTransitionRunning :: (MonadIO m, IsViewStack o) => o -> m Bool
- constructViewStackVhomogeneous :: (IsViewStack o, MonadIO m) => Bool -> m (GValueConstruct o)
- getViewStackVhomogeneous :: (MonadIO m, IsViewStack o) => o -> m Bool
- setViewStackVhomogeneous :: (MonadIO m, IsViewStack o) => o -> Bool -> m ()
- constructViewStackVisibleChild :: (IsViewStack o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getViewStackVisibleChild :: (MonadIO m, IsViewStack o) => o -> m (Maybe Widget)
- setViewStackVisibleChild :: (MonadIO m, IsViewStack o, IsWidget a) => o -> a -> m ()
- constructViewStackVisibleChildName :: (IsViewStack o, MonadIO m) => Text -> m (GValueConstruct o)
- getViewStackVisibleChildName :: (MonadIO m, IsViewStack o) => o -> m (Maybe Text)
- setViewStackVisibleChildName :: (MonadIO m, IsViewStack o) => o -> Text -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq ViewStack Source # | |
GObject ViewStack Source # | |
Defined in GI.Adw.Objects.ViewStack | |
ManagedPtrNewtype ViewStack Source # | |
Defined in GI.Adw.Objects.ViewStack | |
TypedObject ViewStack Source # | |
Defined in GI.Adw.Objects.ViewStack | |
HasParentTypes ViewStack Source # | |
Defined in GI.Adw.Objects.ViewStack | |
IsGValue (Maybe ViewStack) Source # | Convert |
Defined in GI.Adw.Objects.ViewStack | |
type ParentTypes ViewStack Source # | |
Defined in GI.Adw.Objects.ViewStack |
class (GObject o, IsDescendantOf ViewStack o) => IsViewStack o Source #
Type class for types which can be safely cast to ViewStack
, for instance with toViewStack
.
Instances
(GObject o, IsDescendantOf ViewStack o) => IsViewStack o Source # | |
Defined in GI.Adw.Objects.ViewStack |
toViewStack :: (MonadIO m, IsViewStack o) => o -> m ViewStack Source #
Methods
Click to display all available methods, including inherited ones
Methods
actionSetEnabled, activate, activateAction, activateDefault, add, addController, addCssClass, addMnemonicLabel, addNamed, addTickCallback, addTitled, allocate, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, 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, remove, 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, getChildByName, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getHhomogeneous, getInterpolateSize, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPage, getPages, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getTransitionRunning, getValign, getVexpand, getVexpandSet, getVhomogeneous, getVisible, getVisibleChild, getVisibleChildName, getWidth.
Setters
setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setHhomogeneous, setInterpolateSize, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVhomogeneous, setVisible, setVisibleChild, setVisibleChildName.
add
:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) | |
=> a |
|
-> b |
|
-> m ViewStackPage | Returns: the |
Adds a child to self
.
Since: 1.0
addNamed
:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) | |
=> a |
|
-> b |
|
-> Maybe Text |
|
-> m ViewStackPage | Returns: the |
Adds a child to self
.
The child is identified by the name
.
Since: 1.0
addTitled
:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) | |
=> a |
|
-> b |
|
-> Maybe Text |
|
-> Text |
|
-> m ViewStackPage | Returns: the |
Adds a child to self
.
The child is identified by the name
. The title
will be used by
ViewSwitcher
to represent child
, so it should be short.
Since: 1.0
getChildByName
viewStackGetChildByName Source #
:: (HasCallStack, MonadIO m, IsViewStack a) | |
=> a |
|
-> Text |
|
-> m (Maybe Widget) | Returns: the requested child |
Finds the child with name
in self
.
Since: 1.0
getHhomogeneous
viewStackGetHhomogeneous Source #
:: (HasCallStack, MonadIO m, IsViewStack a) | |
=> a |
|
-> m Bool | Returns: whether |
Gets whether self
is horizontally homogeneous.
Since: 1.0
getInterpolateSize
viewStackGetInterpolateSize Source #
:: (HasCallStack, MonadIO m, IsViewStack a) | |
=> a |
|
-> m Bool | Returns: whether child sizes are interpolated |
Gets whether self
will interpolate its size when changing the visible child.
Since: 1.0
getPage
:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) | |
=> a |
|
-> b |
|
-> m ViewStackPage | Returns: the page object for |
Gets the ViewStackPage
object for child
.
Since: 1.0
getPages
:: (HasCallStack, MonadIO m, IsViewStack a) | |
=> a |
|
-> m SelectionModel | Returns: a |
Returns a ListModel
that contains the pages of the stack.
This can be used to keep an up-to-date view. The model also implements
SelectionModel
and can be used to track and change the visible
page.
Since: 1.0
getTransitionRunning
viewStackGetTransitionRunning Source #
:: (HasCallStack, MonadIO m, IsViewStack a) | |
=> a |
|
-> m Bool | Returns: whether a transition is currently running |
Gets whether the self
is currently in a transition from one page to another.
Since: 1.0
getVhomogeneous
viewStackGetVhomogeneous Source #
:: (HasCallStack, MonadIO m, IsViewStack a) | |
=> a |
|
-> m Bool | Returns: whether |
Gets whether self
is vertically homogeneous.
Since: 1.0
getVisibleChild
viewStackGetVisibleChild Source #
:: (HasCallStack, MonadIO m, IsViewStack a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the visible child |
Gets the currently visible child of self
, .
Since: 1.0
getVisibleChildName
viewStackGetVisibleChildName Source #
:: (HasCallStack, MonadIO m, IsViewStack a) | |
=> a |
|
-> m (Maybe Text) | Returns: the name of the visible child |
Returns the name of the currently visible child of self
.
Since: 1.0
new
:: (HasCallStack, MonadIO m) | |
=> m ViewStack | Returns: the newly created |
Creates a new AdwViewStack
.
Since: 1.0
remove
:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) | |
=> a |
|
-> b |
|
-> m () |
Removes a child widget from self
.
Since: 1.0
setHhomogeneous
viewStackSetHhomogeneous Source #
:: (HasCallStack, MonadIO m, IsViewStack a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets self
to be horizontally homogeneous or not.
Since: 1.0
setInterpolateSize
viewStackSetInterpolateSize Source #
:: (HasCallStack, MonadIO m, IsViewStack a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether self
will interpolate its size when changing the visible child.
Since: 1.0
setVhomogeneous
viewStackSetVhomogeneous Source #
:: (HasCallStack, MonadIO m, IsViewStack a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets self
to be vertically homogeneous or not.
Since: 1.0
setVisibleChild
viewStackSetVisibleChild Source #
:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) | |
=> a |
|
-> b |
|
-> m () |
Makes child
the visible child of self
.
Since: 1.0
setVisibleChildName
viewStackSetVisibleChildName Source #
:: (HasCallStack, MonadIO m, IsViewStack a) | |
=> a |
|
-> Text |
|
-> m () |
Makes the child with name
visible.
Since: 1.0
Properties
hhomogeneous
Whether the stack allocates the same width for all children.
If it's FALSE
, the stack may change width when a different child becomes
visible.
Since: 1.0
constructViewStackHhomogeneous :: (IsViewStack o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “hhomogeneous
” property. This is rarely needed directly, but it is used by new
.
getViewStackHhomogeneous :: (MonadIO m, IsViewStack o) => o -> m Bool Source #
Get the value of the “hhomogeneous
” property.
When overloading is enabled, this is equivalent to
get
viewStack #hhomogeneous
setViewStackHhomogeneous :: (MonadIO m, IsViewStack o) => o -> Bool -> m () Source #
Set the value of the “hhomogeneous
” property.
When overloading is enabled, this is equivalent to
set
viewStack [ #hhomogeneous:=
value ]
interpolateSize
Whether the stack interpolates its size when changing the visible child.
Since: 1.0
constructViewStackInterpolateSize :: (IsViewStack o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “interpolate-size
” property. This is rarely needed directly, but it is used by new
.
getViewStackInterpolateSize :: (MonadIO m, IsViewStack o) => o -> m Bool Source #
Get the value of the “interpolate-size
” property.
When overloading is enabled, this is equivalent to
get
viewStack #interpolateSize
setViewStackInterpolateSize :: (MonadIO m, IsViewStack o) => o -> Bool -> m () Source #
Set the value of the “interpolate-size
” property.
When overloading is enabled, this is equivalent to
set
viewStack [ #interpolateSize:=
value ]
pages
A selection model with the stack's pages.
This can be used to keep an up-to-date view. The model also implements
SelectionModel
and can be used to track and change the visible
page.
getViewStackPages :: (MonadIO m, IsViewStack o) => o -> m (Maybe SelectionModel) Source #
Get the value of the “pages
” property.
When overloading is enabled, this is equivalent to
get
viewStack #pages
transitionRunning
Whether a transition is currently running.
Since: 1.0
getViewStackTransitionRunning :: (MonadIO m, IsViewStack o) => o -> m Bool Source #
Get the value of the “transition-running
” property.
When overloading is enabled, this is equivalent to
get
viewStack #transitionRunning
vhomogeneous
Whether the stack allocates the same height for all children.
If it's FALSE
, the stack may change height when a different child becomes
visible.
Since: 1.0
constructViewStackVhomogeneous :: (IsViewStack o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “vhomogeneous
” property. This is rarely needed directly, but it is used by new
.
getViewStackVhomogeneous :: (MonadIO m, IsViewStack o) => o -> m Bool Source #
Get the value of the “vhomogeneous
” property.
When overloading is enabled, this is equivalent to
get
viewStack #vhomogeneous
setViewStackVhomogeneous :: (MonadIO m, IsViewStack o) => o -> Bool -> m () Source #
Set the value of the “vhomogeneous
” property.
When overloading is enabled, this is equivalent to
set
viewStack [ #vhomogeneous:=
value ]
visibleChild
The widget currently visible in the stack.
Since: 1.0
constructViewStackVisibleChild :: (IsViewStack o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “visible-child
” property. This is rarely needed directly, but it is used by new
.
getViewStackVisibleChild :: (MonadIO m, IsViewStack o) => o -> m (Maybe Widget) Source #
Get the value of the “visible-child
” property.
When overloading is enabled, this is equivalent to
get
viewStack #visibleChild
setViewStackVisibleChild :: (MonadIO m, IsViewStack o, IsWidget a) => o -> a -> m () Source #
Set the value of the “visible-child
” property.
When overloading is enabled, this is equivalent to
set
viewStack [ #visibleChild:=
value ]
visibleChildName
constructViewStackVisibleChildName :: (IsViewStack o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “visible-child-name
” property. This is rarely needed directly, but it is used by new
.
getViewStackVisibleChildName :: (MonadIO m, IsViewStack o) => o -> m (Maybe Text) Source #
Get the value of the “visible-child-name
” property.
When overloading is enabled, this is equivalent to
get
viewStack #visibleChildName
setViewStackVisibleChildName :: (MonadIO m, IsViewStack o) => o -> Text -> m () Source #
Set the value of the “visible-child-name
” property.
When overloading is enabled, this is equivalent to
set
viewStack [ #visibleChildName:=
value ]