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.
A widget letting you switch between multiple views contained by a
ViewStack
via an ViewSwitcher
.
It is designed to be used as the title widget of a HeaderBar
, 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.
You can conveniently bind the ViewSwitcherBar:reveal property to ViewSwitcherTitle:titleVisible to automatically reveal the view switcher bar when the title label is displayed in place of the view switcher.
An example of the UI definition for a common use case:
xml code
<object class="GtkWindow"/> <child type="titlebar"> <object class="AdwHeaderBar"> <property name="centering-policy">strict</property> <child type="title"> <object class="AdwViewSwitcherTitle" id="title"> <property name="stack">stack</property> </object> </child> </object> </child> <child> <object class="GtkBox"> <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> </child> </object>
CSS nodes
AdwViewSwitcherTitle
has a single CSS node with name viewswitchertitle
.
Since: 1.0
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.
Instances
Eq ViewSwitcherTitle Source # | |
Defined in GI.Adw.Objects.ViewSwitcherTitle (==) :: ViewSwitcherTitle -> ViewSwitcherTitle -> Bool # (/=) :: ViewSwitcherTitle -> ViewSwitcherTitle -> Bool # | |
GObject ViewSwitcherTitle Source # | |
Defined in GI.Adw.Objects.ViewSwitcherTitle | |
ManagedPtrNewtype ViewSwitcherTitle Source # | |
TypedObject ViewSwitcherTitle Source # | |
Defined in GI.Adw.Objects.ViewSwitcherTitle | |
HasParentTypes ViewSwitcherTitle Source # | |
Defined in GI.Adw.Objects.ViewSwitcherTitle | |
IsGValue (Maybe ViewSwitcherTitle) Source # | Convert |
Defined in GI.Adw.Objects.ViewSwitcherTitle gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe ViewSwitcherTitle -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe ViewSwitcherTitle) # | |
type ParentTypes ViewSwitcherTitle Source # | |
Defined in GI.Adw.Objects.ViewSwitcherTitle |
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, 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, 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, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStack, getStateFlags, getStyleContext, getSubtitle, getTemplateChild, getTitle, getTitleVisible, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getViewSwitcherEnabled, 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, 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 |
Gets the stack controlled by self
.
Since: 1.0
getSubtitle
viewSwitcherTitleGetSubtitle Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> m Text | Returns: the subtitle |
Gets the subtitle of self
.
Since: 1.0
getTitle
viewSwitcherTitleGetTitle Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> m Text | Returns: the title |
Gets the title of self
.
Since: 1.0
getTitleVisible
viewSwitcherTitleGetTitleVisible Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> m Bool | Returns: whether the title of |
Gets whether the title of self
is currently visible.
Since: 1.0
getViewSwitcherEnabled
viewSwitcherTitleGetViewSwitcherEnabled Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> m Bool | Returns: whether the view switcher is enabled |
Gets whether self
's view switcher is enabled.
Since: 1.0
new
:: (HasCallStack, MonadIO m) | |
=> m ViewSwitcherTitle | Returns: the newly created |
Creates a new AdwViewSwitcherTitle
.
Since: 1.0
setStack
viewSwitcherTitleSetStack Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a, IsViewStack b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the stack controlled by self
.
Since: 1.0
setSubtitle
viewSwitcherTitleSetSubtitle Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the subtitle of self
.
Since: 1.0
setTitle
viewSwitcherTitleSetTitle Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the title of self
.
Since: 1.0
setViewSwitcherEnabled
viewSwitcherTitleSetViewSwitcherEnabled Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether self
's view switcher is enabled.
Since: 1.0
Properties
stack
The stack the view switcher controls.
Since: 1.0
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 a user additional details.
Since: 1.0
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 should give a user additional details. A good title should not include the application name.
Since: 1.0
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 ViewSwitcherBar
.
Since: 1.0
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.
Since: 1.0
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 ]