gi-adwaita-1.0.1: Adwaita bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Adw.Objects.ViewStack

Description

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

Exported types

newtype ViewStack Source #

Memory-managed wrapper type.

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

Instances details
(GObject o, IsDescendantOf ViewStack o) => IsViewStack o Source # 
Instance details

Defined in GI.Adw.Objects.ViewStack

toViewStack :: (MonadIO m, IsViewStack o) => o -> m ViewStack Source #

Cast to ViewStack, 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

Expand

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

viewStackAdd Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) 
=> a

self: a AdwViewStack

-> b

child: the widget to add

-> m ViewStackPage

Returns: the ViewStackPage for child

Adds a child to self.

Since: 1.0

addNamed

viewStackAddNamed Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) 
=> a

self: a AdwViewStack

-> b

child: the widget to add

-> Maybe Text

name: the name for child

-> m ViewStackPage

Returns: the AdwViewStackPage for child

Adds a child to self.

The child is identified by the name.

Since: 1.0

addTitled

viewStackAddTitled Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) 
=> a

self: a AdwViewStack

-> b

child: the widget to add

-> Maybe Text

name: the name for child

-> Text

title: a human-readable title for child

-> m ViewStackPage

Returns: the AdwViewStackPage for child

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 #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a AdwViewStack

-> Text

name: the name of the child to find

-> m (Maybe Widget)

Returns: the requested child

Finds the child with name in self.

Since: 1.0

getHhomogeneous

viewStackGetHhomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a AdwViewStack

-> m Bool

Returns: whether self is horizontally homogeneous

Gets whether self is horizontally homogeneous.

Since: 1.0

getInterpolateSize

viewStackGetInterpolateSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: A AdwViewStack

-> m Bool

Returns: whether child sizes are interpolated

Gets whether self will interpolate its size when changing the visible child.

Since: 1.0

getPage

viewStackGetPage Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) 
=> a

self: a AdwViewStack

-> b

child: a child of self

-> m ViewStackPage

Returns: the page object for child

Gets the ViewStackPage object for child.

Since: 1.0

getPages

viewStackGetPages Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a AdwViewStack

-> m SelectionModel

Returns: a GtkSelectionModel for the stack's children

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 #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a AdwViewStack

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a AdwViewStack

-> m Bool

Returns: whether self is vertically homogeneous

Gets whether self is vertically homogeneous.

Since: 1.0

getVisibleChild

viewStackGetVisibleChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a AdwViewStack

-> m (Maybe Widget)

Returns: the visible child

Gets the currently visible child of self, .

Since: 1.0

getVisibleChildName

viewStackGetVisibleChildName Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a AdwViewStack

-> m (Maybe Text)

Returns: the name of the visible child

Returns the name of the currently visible child of self.

Since: 1.0

new

viewStackNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m ViewStack

Returns: the newly created AdwViewStack

Creates a new AdwViewStack.

Since: 1.0

remove

viewStackRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) 
=> a

self: a AdwViewStack

-> b

child: the child to remove

-> m () 

Removes a child widget from self.

Since: 1.0

setHhomogeneous

viewStackSetHhomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a AdwViewStack

-> Bool

hhomogeneous: whether to make self horizontally homogeneous

-> m () 

Sets self to be horizontally homogeneous or not.

Since: 1.0

setInterpolateSize

viewStackSetInterpolateSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: A AdwViewStack

-> Bool

interpolateSize: the new value

-> m () 

Sets whether self will interpolate its size when changing the visible child.

Since: 1.0

setVhomogeneous

viewStackSetVhomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a AdwViewStack

-> Bool

vhomogeneous: whether to make self vertically homogeneous

-> m () 

Sets self to be vertically homogeneous or not.

Since: 1.0

setVisibleChild

viewStackSetVisibleChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) 
=> a

self: a AdwViewStack

-> b

child: a child of self

-> m () 

Makes child the visible child of self.

Since: 1.0

setVisibleChildName

viewStackSetVisibleChildName Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a AdwViewStack

-> Text

name: the name of the child

-> 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

The name of the widget currently visible in the stack.

See ViewStack:visibleChild.

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 ]