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 [classviewSwitcher
].
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 [classviewSwitcher
] 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 [classviewSwitcher
] will use to let users identify which
page is which. Set them using the [propertyviewStackPage
:title],
[propertyviewStackPage
:icon-name],
[propertyviewStackPage
:needs-attention], and
[propertyviewStackPage
:badge-number] properties.
Unlike Stack
, transitions between views are not animated.
AdwViewStack
maintains a [classviewStackPage
] object for each added child,
which holds additional per-child properties. You obtain the
[classviewStackPage
] for a child with [methodviewStack
.get_page] and you
can obtain a SelectionModel
containing all the pages with
[methodviewStack
.get_pages].
AdwViewStack as GtkBuildable
To set child-specific properties in a .ui file, create
[classviewStackPage
] 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> </object>
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
- viewStackAddTitledWithIcon :: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) => a -> b -> Maybe Text -> Text -> Text -> m ViewStackPage
- viewStackGetChildByName :: (HasCallStack, MonadIO m, IsViewStack a) => a -> Text -> m (Maybe Widget)
- viewStackGetHhomogeneous :: (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
- 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 ()
- 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 ()
- getViewStackPages :: (MonadIO m, IsViewStack o) => o -> m (Maybe SelectionModel)
- 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 toManagedPtr :: ViewStack -> ManagedPtr 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 gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe ViewStack -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe ViewStack) | |
type ParentTypes ViewStack Source # | |
Defined in GI.Adw.Objects.ViewStack type ParentTypes ViewStack = '[Widget, Object, Accessible, Buildable, ConstraintTarget] |
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, addTitledWithIcon, 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, 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, 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, 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, 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 [class |
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
[classviewSwitcher
] to represent child
, so it should be short.
Since: 1.0
addTitledWithIcon
viewStackAddTitledWithIcon Source #
:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) | |
=> a |
|
-> b |
|
-> Maybe Text |
|
-> Text |
|
-> Text |
|
-> m ViewStackPage | Returns: the |
Adds a child to self
.
The child is identified by the name
. The title
and iconName
will be used
by [classviewSwitcher
] to represent child
.
Since: 1.2
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
getPage
:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) | |
=> a |
|
-> b |
|
-> m ViewStackPage | Returns: the page object for |
Gets the [classviewStackPage
] 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
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.
If the stack is horizontally homogeneous, it 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
setVhomogeneous
viewStackSetVhomogeneous Source #
:: (HasCallStack, MonadIO m, IsViewStack a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets self
to be vertically homogeneous or not.
If the stack is vertically homogeneous, it 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
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.
See [propertyviewStack
:visible-child].
Since: 1.0
Properties
hhomogeneous
Whether the stack is horizontally homogeneous.
If the stack is horizontally homogeneous, it 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 ]
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
vhomogeneous
Whether the stack is vertically homogeneous.
If the stack is vertically homogeneous, it 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
The name of the widget currently visible in the stack.
See [propertyviewStack
:visible-child].
Since: 1.0
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 ]