gi-adwaita-1.0.7: 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.ViewSwitcherTitle

Description

A view switcher title.

<picture> <source srcset="view-switcher-title-dark.png" media="(prefers-color-scheme: dark)"> <img src="view-switcher-title.png" alt="view-switcher-title"> </picture>

A widget letting you switch between multiple views contained by a [classviewStack] via an [classviewSwitcher].

It is designed to be used as the title widget of a [classheaderBar], and will display the window's title when the window is too narrow to fit the view switcher e.g. on mobile phones, or if there are less than two views.

In order to center the title in narrow windows, the header bar should have [propertyheaderBar:centering-policy] set to ADW_CENTERING_POLICY_STRICT.

AdwViewSwitcherTitle is intended to be used together with [classviewSwitcherBar].

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="AdwWindow">
  <property name="content">
    <object class="AdwToolbarView">
      <child type="top">
        <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>
      </child>
      <property name="content">
        <object class="AdwViewStack" id="stack"/>
      </property>
      <child type="bottom">
        <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

AdwViewSwitcherTitle has a single CSS node with name viewswitchertitle.

Synopsis

Exported types

newtype ViewSwitcherTitle Source #

Memory-managed wrapper type.

Constructors

ViewSwitcherTitle (ManagedPtr ViewSwitcherTitle) 

Instances

Instances details
Eq ViewSwitcherTitle Source # 
Instance details

Defined in GI.Adw.Objects.ViewSwitcherTitle

GObject ViewSwitcherTitle Source # 
Instance details

Defined in GI.Adw.Objects.ViewSwitcherTitle

ManagedPtrNewtype ViewSwitcherTitle Source # 
Instance details

Defined in GI.Adw.Objects.ViewSwitcherTitle

TypedObject ViewSwitcherTitle Source # 
Instance details

Defined in GI.Adw.Objects.ViewSwitcherTitle

Methods

glibType :: IO GType

HasParentTypes ViewSwitcherTitle Source # 
Instance details

Defined in GI.Adw.Objects.ViewSwitcherTitle

IsGValue (Maybe ViewSwitcherTitle) Source #

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

Instance details

Defined in GI.Adw.Objects.ViewSwitcherTitle

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes ViewSwitcherTitle Source # 
Instance details

Defined in GI.Adw.Objects.ViewSwitcherTitle

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

class (GObject o, IsDescendantOf ViewSwitcherTitle o) => IsViewSwitcherTitle o Source #

Type class for types which can be safely cast to ViewSwitcherTitle, for instance with toViewSwitcherTitle.

Instances

Instances details
(GObject o, IsDescendantOf ViewSwitcherTitle o) => IsViewSwitcherTitle o Source # 
Instance details

Defined in GI.Adw.Objects.ViewSwitcherTitle

toViewSwitcherTitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> m ViewSwitcherTitle Source #

Cast to ViewSwitcherTitle, 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, announce, 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, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBaseline, getBounds, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStack, getStateFlags, getStyleContext, getSubtitle, getTemplateChild, getTitle, getTitleVisible, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getViewSwitcherEnabled, getVisible, getWidth.

Setters

setAccessibleParent, 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, setSensitive, setSizeRequest, setStack, setStateFlags, setSubtitle, setTitle, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setViewSwitcherEnabled, setVisible.

getStack

viewSwitcherTitleGetStack Source #

Arguments

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

self: a view switcher title

-> m (Maybe ViewStack)

Returns: the stack

Deprecated: (Since version 1.4)See the migration guide

Gets the stack controlled by self.

getSubtitle

viewSwitcherTitleGetSubtitle Source #

Arguments

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

self: a view switcher title

-> m Text

Returns: the subtitle

Deprecated: (Since version 1.4)See the migration guide

Gets the subtitle of self.

getTitle

viewSwitcherTitleGetTitle Source #

Arguments

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

self: a view switcher title

-> m Text

Returns: the title

Deprecated: (Since version 1.4)See the migration guide

Gets the title of self.

getTitleVisible

viewSwitcherTitleGetTitleVisible Source #

Arguments

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

self: a view switcher title

-> m Bool

Returns: whether the title of self is currently visible

Deprecated: (Since version 1.4)See the migration guide

Gets whether the title of self is currently visible.

If the title is visible, it means the view switcher is hidden an it may be wanted to show an alternative switcher, e.g. a [classviewSwitcherBar].

getViewSwitcherEnabled

viewSwitcherTitleGetViewSwitcherEnabled Source #

Arguments

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

self: a view switcher title

-> m Bool

Returns: whether the view switcher is enabled

Deprecated: (Since version 1.4)See the migration guide

Gets whether self's view switcher is enabled.

new

viewSwitcherTitleNew Source #

Arguments

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

Returns: the newly created AdwViewSwitcherTitle

Deprecated: (Since version 1.4)See the migration guide

Creates a new AdwViewSwitcherTitle.

setStack

viewSwitcherTitleSetStack Source #

Arguments

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

self: a view switcher title

-> Maybe b

stack: a stack

-> m () 

Deprecated: (Since version 1.4)See the migration guide

Sets the stack controlled by self.

setSubtitle

viewSwitcherTitleSetSubtitle Source #

Arguments

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

self: a view switcher title

-> Text

subtitle: a subtitle

-> m () 

Deprecated: (Since version 1.4)See the migration guide

Sets the subtitle of self.

The subtitle should give the user additional details.

setTitle

viewSwitcherTitleSetTitle Source #

Arguments

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

self: a view switcher title

-> Text

title: a title

-> m () 

Deprecated: (Since version 1.4)See the migration guide

Sets the title of self.

The title typically identifies the current view or content item, and generally does not use the application name.

setViewSwitcherEnabled

viewSwitcherTitleSetViewSwitcherEnabled Source #

Arguments

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

self: a view switcher title

-> Bool

enabled: whether the view switcher is enabled

-> m () 

Deprecated: (Since version 1.4)See the migration guide

Sets whether self's view switcher is enabled.

If it is disabled, the title will be displayed instead. This allows to programmatically hide the view switcher even if it fits in the available space.

This can be used e.g. to ensure the view switcher is hidden below a certain window width, or any other constraint you find suitable.

Properties

stack

The stack the view switcher controls.

clearViewSwitcherTitleStack :: (MonadIO m, IsViewSwitcherTitle o) => o -> m () Source #

Set the value of the “stack” property to Nothing. When overloading is enabled, this is equivalent to

clear #stack

constructViewSwitcherTitleStack :: (IsViewSwitcherTitle 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.

getViewSwitcherTitleStack :: (MonadIO m, IsViewSwitcherTitle o) => o -> m (Maybe ViewStack) Source #

Get the value of the “stack” property. When overloading is enabled, this is equivalent to

get viewSwitcherTitle #stack

setViewSwitcherTitleStack :: (MonadIO m, IsViewSwitcherTitle o, IsViewStack a) => o -> a -> m () Source #

Set the value of the “stack” property. When overloading is enabled, this is equivalent to

set viewSwitcherTitle [ #stack := value ]

subtitle

The subtitle to display.

The subtitle should give the user additional details.

constructViewSwitcherTitleSubtitle :: (IsViewSwitcherTitle o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “subtitle” property. This is rarely needed directly, but it is used by new.

getViewSwitcherTitleSubtitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> m Text Source #

Get the value of the “subtitle” property. When overloading is enabled, this is equivalent to

get viewSwitcherTitle #subtitle

setViewSwitcherTitleSubtitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> Text -> m () Source #

Set the value of the “subtitle” property. When overloading is enabled, this is equivalent to

set viewSwitcherTitle [ #subtitle := value ]

title

The title to display.

The title typically identifies the current view or content item, and generally does not use the application name.

constructViewSwitcherTitleTitle :: (IsViewSwitcherTitle o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “title” property. This is rarely needed directly, but it is used by new.

getViewSwitcherTitleTitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> m Text Source #

Get the value of the “title” property. When overloading is enabled, this is equivalent to

get viewSwitcherTitle #title

setViewSwitcherTitleTitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> Text -> m () Source #

Set the value of the “title” property. When overloading is enabled, this is equivalent to

set viewSwitcherTitle [ #title := value ]

titleVisible

Whether the title is currently visible.

If the title is visible, it means the view switcher is hidden an it may be wanted to show an alternative switcher, e.g. a [classviewSwitcherBar].

getViewSwitcherTitleTitleVisible :: (MonadIO m, IsViewSwitcherTitle o) => o -> m Bool Source #

Get the value of the “title-visible” property. When overloading is enabled, this is equivalent to

get viewSwitcherTitle #titleVisible

viewSwitcherEnabled

Whether the view switcher is enabled.

If it is disabled, the title will be displayed instead. This allows to programmatically hide the view switcher even if it fits in the available space.

This can be used e.g. to ensure the view switcher is hidden below a certain window width, or any other constraint you find suitable.

constructViewSwitcherTitleViewSwitcherEnabled :: (IsViewSwitcherTitle o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “view-switcher-enabled” property. This is rarely needed directly, but it is used by new.

getViewSwitcherTitleViewSwitcherEnabled :: (MonadIO m, IsViewSwitcherTitle o) => o -> m Bool Source #

Get the value of the “view-switcher-enabled” property. When overloading is enabled, this is equivalent to

get viewSwitcherTitle #viewSwitcherEnabled

setViewSwitcherTitleViewSwitcherEnabled :: (MonadIO m, IsViewSwitcherTitle o) => o -> Bool -> m () Source #

Set the value of the “view-switcher-enabled” property. When overloading is enabled, this is equivalent to

set viewSwitcherTitle [ #viewSwitcherEnabled := value ]