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 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
- newtype ViewSwitcherTitle = ViewSwitcherTitle (ManagedPtr ViewSwitcherTitle)
- class (GObject o, IsDescendantOf ViewSwitcherTitle o) => IsViewSwitcherTitle o
- toViewSwitcherTitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> m ViewSwitcherTitle
- viewSwitcherTitleGetStack :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> m (Maybe ViewStack)
- viewSwitcherTitleGetSubtitle :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> m Text
- viewSwitcherTitleGetTitle :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> m Text
- viewSwitcherTitleGetTitleVisible :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> m Bool
- viewSwitcherTitleGetViewSwitcherEnabled :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> m Bool
- viewSwitcherTitleNew :: (HasCallStack, MonadIO m) => m ViewSwitcherTitle
- viewSwitcherTitleSetStack :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a, IsViewStack b) => a -> Maybe b -> m ()
- viewSwitcherTitleSetSubtitle :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> Text -> m ()
- viewSwitcherTitleSetTitle :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> Text -> m ()
- viewSwitcherTitleSetViewSwitcherEnabled :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> Bool -> m ()
- clearViewSwitcherTitleStack :: (MonadIO m, IsViewSwitcherTitle o) => o -> m ()
- constructViewSwitcherTitleStack :: (IsViewSwitcherTitle o, MonadIO m, IsViewStack a) => a -> m (GValueConstruct o)
- getViewSwitcherTitleStack :: (MonadIO m, IsViewSwitcherTitle o) => o -> m (Maybe ViewStack)
- setViewSwitcherTitleStack :: (MonadIO m, IsViewSwitcherTitle o, IsViewStack a) => o -> a -> m ()
- constructViewSwitcherTitleSubtitle :: (IsViewSwitcherTitle o, MonadIO m) => Text -> m (GValueConstruct o)
- getViewSwitcherTitleSubtitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> m Text
- setViewSwitcherTitleSubtitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> Text -> m ()
- constructViewSwitcherTitleTitle :: (IsViewSwitcherTitle o, MonadIO m) => Text -> m (GValueConstruct o)
- getViewSwitcherTitleTitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> m Text
- setViewSwitcherTitleTitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> Text -> m ()
- getViewSwitcherTitleTitleVisible :: (MonadIO m, IsViewSwitcherTitle o) => o -> m Bool
- constructViewSwitcherTitleViewSwitcherEnabled :: (IsViewSwitcherTitle o, MonadIO m) => Bool -> m (GValueConstruct o)
- getViewSwitcherTitleViewSwitcherEnabled :: (MonadIO m, IsViewSwitcherTitle o) => o -> m Bool
- setViewSwitcherTitleViewSwitcherEnabled :: (MonadIO m, IsViewSwitcherTitle o) => o -> Bool -> m ()
Exported types
newtype ViewSwitcherTitle Source #
Memory-managed wrapper type.
ViewSwitcherTitle (ManagedPtr ViewSwitcherTitle) |
Instances
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
(GObject o, IsDescendantOf ViewSwitcherTitle o) => IsViewSwitcherTitle o Source # | |
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
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 #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> m (Maybe ViewStack) | Returns: the stack |
Deprecated: (Since version 1.4)See the migration guide
Gets the stack controlled by self
.
getSubtitle
viewSwitcherTitleGetSubtitle Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> m Text | Returns: the subtitle |
Deprecated: (Since version 1.4)See the migration guide
Gets the subtitle of self
.
getTitle
viewSwitcherTitleGetTitle Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> m Text | Returns: the title |
Deprecated: (Since version 1.4)See the migration guide
Gets the title of self
.
getTitleVisible
viewSwitcherTitleGetTitleVisible Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> m Bool | Returns: whether the title of |
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 #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m) | |
=> m ViewSwitcherTitle | Returns: the newly created |
Deprecated: (Since version 1.4)See the migration guide
Creates a new AdwViewSwitcherTitle
.
setStack
viewSwitcherTitleSetStack Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a, IsViewStack b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Deprecated: (Since version 1.4)See the migration guide
Sets the stack controlled by self
.
setSubtitle
viewSwitcherTitleSetSubtitle Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> Text |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> Text |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> Bool |
|
-> 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 ]