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
Stack
, 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.
HdyViewSwitcherTitle
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="GtkWindow"/> <child type="titlebar"> <object class="HdyHeaderBar"> <property name="centering-policy">strict</property> <child type="title"> <object class="HdyViewSwitcherTitle" id="view_switcher_title"> <property name="stack">stack</property> </object> </child> </object> </child> <child> <object class="GtkBox"> <child> <object class="GtkStack" id="stack"/> </child> <child> <object class="HdyViewSwitcherBar"> <property name="stack">stack</property> <property name="reveal" bind-source="view_switcher_title" bind-property="title-visible" bind-flags="sync-create"/> </object> </child> </object> </child> </object>
CSS nodes
HdyViewSwitcherTitle
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
- viewSwitcherTitleGetPolicy :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> m ViewSwitcherPolicy
- viewSwitcherTitleGetStack :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> m (Maybe Stack)
- viewSwitcherTitleGetSubtitle :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> m (Maybe Text)
- viewSwitcherTitleGetTitle :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> m (Maybe 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
- viewSwitcherTitleSetPolicy :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> ViewSwitcherPolicy -> m ()
- viewSwitcherTitleSetStack :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a, IsStack b) => a -> Maybe b -> m ()
- viewSwitcherTitleSetSubtitle :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> Maybe Text -> m ()
- viewSwitcherTitleSetTitle :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> Maybe Text -> m ()
- viewSwitcherTitleSetViewSwitcherEnabled :: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) => a -> Bool -> m ()
- constructViewSwitcherTitlePolicy :: (IsViewSwitcherTitle o, MonadIO m) => ViewSwitcherPolicy -> m (GValueConstruct o)
- getViewSwitcherTitlePolicy :: (MonadIO m, IsViewSwitcherTitle o) => o -> m ViewSwitcherPolicy
- setViewSwitcherTitlePolicy :: (MonadIO m, IsViewSwitcherTitle o) => o -> ViewSwitcherPolicy -> m ()
- clearViewSwitcherTitleStack :: (MonadIO m, IsViewSwitcherTitle o) => o -> m ()
- constructViewSwitcherTitleStack :: (IsViewSwitcherTitle o, MonadIO m, IsStack a) => a -> m (GValueConstruct o)
- getViewSwitcherTitleStack :: (MonadIO m, IsViewSwitcherTitle o) => o -> m (Maybe Stack)
- setViewSwitcherTitleStack :: (MonadIO m, IsViewSwitcherTitle o, IsStack a) => o -> a -> m ()
- clearViewSwitcherTitleSubtitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> m ()
- constructViewSwitcherTitleSubtitle :: (IsViewSwitcherTitle o, MonadIO m) => Text -> m (GValueConstruct o)
- getViewSwitcherTitleSubtitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> m (Maybe Text)
- setViewSwitcherTitleSubtitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> Text -> m ()
- clearViewSwitcherTitleTitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> m ()
- constructViewSwitcherTitleTitle :: (IsViewSwitcherTitle o, MonadIO m) => Text -> m (GValueConstruct o)
- getViewSwitcherTitleTitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> m (Maybe 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.Handy.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
activate, add, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, propagateDraw, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, watchClosure.
Getters
getAccessible, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getBorderWidth, getCanDefault, getCanFocus, getChild, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getInternalChild, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPolicy, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSizeRequest, getStack, getState, getStateFlags, getStyle, getStyleContext, getSubtitle, getSupportMultidevice, getTemplateChild, getTitle, getTitleVisible, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getViewSwitcherEnabled, getVisible, getVisual, getWindow.
Setters
setAccelPath, setAllocation, setAppPaintable, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setParent, setParentWindow, setPolicy, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSensitive, setSizeRequest, setStack, setState, setStateFlags, setStyle, setSubtitle, setSupportMultidevice, setTitle, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setViewSwitcherEnabled, setVisible, setVisual, setWindow.
getPolicy
viewSwitcherTitleGetPolicy Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> m ViewSwitcherPolicy | Returns: the policy of |
Gets the policy of self
.
Since: 1.0
getStack
viewSwitcherTitleGetStack Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> m (Maybe Stack) | Returns: the stack |
Gets the stack controlled by self
.
Since: 1.0
getSubtitle
viewSwitcherTitleGetSubtitle Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> m (Maybe Text) | Returns: the subtitle of |
Gets the subtitle of self
.
Since: 1.0
getTitle
viewSwitcherTitleGetTitle Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> m (Maybe Text) | Returns: the title of |
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 HdyViewSwitcherTitle
.
Since: 1.0
setPolicy
viewSwitcherTitleSetPolicy Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> ViewSwitcherPolicy |
|
-> m () |
Sets the policy of self
.
Since: 1.0
setStack
viewSwitcherTitleSetStack Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a, IsStack b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the Stack
to control.
Since: 1.0
setSubtitle
viewSwitcherTitleSetSubtitle Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Sets the subtitle of self
.
Since: 1.0
setTitle
viewSwitcherTitleSetTitle Source #
:: (HasCallStack, MonadIO m, IsViewSwitcherTitle a) | |
=> a |
|
-> Maybe 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
policy
The policy used to determine which mode to use.
Since: 1.0
constructViewSwitcherTitlePolicy :: (IsViewSwitcherTitle o, MonadIO m) => ViewSwitcherPolicy -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “policy
” property. This is rarely needed directly, but it is used by new
.
getViewSwitcherTitlePolicy :: (MonadIO m, IsViewSwitcherTitle o) => o -> m ViewSwitcherPolicy Source #
Get the value of the “policy
” property.
When overloading is enabled, this is equivalent to
get
viewSwitcherTitle #policy
setViewSwitcherTitlePolicy :: (MonadIO m, IsViewSwitcherTitle o) => o -> ViewSwitcherPolicy -> m () Source #
Set the value of the “policy
” property.
When overloading is enabled, this is equivalent to
set
viewSwitcherTitle [ #policy:=
value ]
stack
The Stack
the [classviewSwitcher
] 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, IsStack 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 Stack) Source #
Get the value of the “stack
” property.
When overloading is enabled, this is equivalent to
get
viewSwitcherTitle #stack
setViewSwitcherTitleStack :: (MonadIO m, IsViewSwitcherTitle o, IsStack 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 of the [classviewSwitcher
].
The subtitle should give a user additional details.
Since: 1.0
clearViewSwitcherTitleSubtitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> m () Source #
Set the value of the “subtitle
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#subtitle
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 (Maybe 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 of the [classviewSwitcher
].
The title should give a user additional details. A good title should not include the application name.
Since: 1.0
clearViewSwitcherTitleTitle :: (MonadIO m, IsViewSwitcherTitle o) => o -> m () Source #
Set the value of the “title
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#title
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 (Maybe 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 bar should be revealed or hidden.
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 bar should be revealed or hidden.
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 ]