gi-adwaita-1.0.3: 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.ViewSwitcherBar

Description

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

Exported types

newtype ViewSwitcherBar Source #

Memory-managed wrapper type.

Constructors

ViewSwitcherBar (ManagedPtr ViewSwitcherBar) 

Instances

Instances details
Eq ViewSwitcherBar Source # 
Instance details

Defined in GI.Adw.Objects.ViewSwitcherBar

GObject ViewSwitcherBar Source # 
Instance details

Defined in GI.Adw.Objects.ViewSwitcherBar

ManagedPtrNewtype ViewSwitcherBar Source # 
Instance details

Defined in GI.Adw.Objects.ViewSwitcherBar

TypedObject ViewSwitcherBar Source # 
Instance details

Defined in GI.Adw.Objects.ViewSwitcherBar

Methods

glibType :: IO GType

HasParentTypes ViewSwitcherBar Source # 
Instance details

Defined in GI.Adw.Objects.ViewSwitcherBar

IsGValue (Maybe ViewSwitcherBar) Source #

Convert ViewSwitcherBar to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Adw.Objects.ViewSwitcherBar

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe ViewSwitcherBar -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe ViewSwitcherBar)

type ParentTypes ViewSwitcherBar Source # 
Instance details

Defined in GI.Adw.Objects.ViewSwitcherBar

type ParentTypes ViewSwitcherBar = '[Widget, Object, Accessible, Buildable, ConstraintTarget]

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

Instances details
(GObject o, IsDescendantOf ViewSwitcherBar o) => IsViewSwitcherBar o Source # 
Instance details

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

Expand

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 #

Arguments

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

self: a view switcher bar

-> m Bool

Returns: whether self is revealed

Gets whether self should be revealed or hidden.

Since: 1.0

getStack

viewSwitcherBarGetStack Source #

Arguments

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

self: a view switcher bar

-> m (Maybe ViewStack)

Returns: the stack

Gets the stack controlled by self.

Since: 1.0

new

viewSwitcherBarNew Source #

Arguments

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

Returns: the newly created AdwViewSwitcherBar

Creates a new AdwViewSwitcherBar.

Since: 1.0

setReveal

viewSwitcherBarSetReveal Source #

Arguments

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

self: a view switcher bar

-> Bool

reveal: whether to reveal self

-> m () 

Sets whether self should be revealed or hidden.

Since: 1.0

setStack

viewSwitcherBarSetStack Source #

Arguments

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

self: a view switcher bar

-> Maybe b

stack: a stack

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