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 |
GI.Adw.Objects.ViewSwitcher
Description
An adaptive view switcher.
<picture> <source srcset="view-switcher-dark.png" media="(prefers-color-scheme: dark)"> <img src="view-switcher.png" alt="view-switcher"> </picture>
An adaptive view switcher designed to switch between multiple views
contained in a [classviewStack
] in a similar fashion to
StackSwitcher
.
AdwViewSwitcher
buttons always have an icon and a label. They can be
displayed side by side, or icon on top of the label. This can be controlled
via the [propertyviewSwitcher
:policy] property.
Most applications should be using [classviewSwitcherBar
] and
[classviewSwitcherTitle
].
CSS nodes
AdwViewSwitcher
has a single CSS node with name viewswitcher
. It can have
the style classes .wide
and .narrow
, matching its policy.
Accessibility
AdwViewSwitcher
uses the GTK_ACCESSIBLE_ROLE_TAB_LIST
role and uses the
GTK_ACCESSIBLE_ROLE_TAB
for its buttons.
Synopsis
- newtype ViewSwitcher = ViewSwitcher (ManagedPtr ViewSwitcher)
- class (GObject o, IsDescendantOf ViewSwitcher o) => IsViewSwitcher o
- toViewSwitcher :: (MonadIO m, IsViewSwitcher o) => o -> m ViewSwitcher
- viewSwitcherGetPolicy :: (HasCallStack, MonadIO m, IsViewSwitcher a) => a -> m ViewSwitcherPolicy
- viewSwitcherGetStack :: (HasCallStack, MonadIO m, IsViewSwitcher a) => a -> m (Maybe ViewStack)
- viewSwitcherNew :: (HasCallStack, MonadIO m) => m ViewSwitcher
- viewSwitcherSetPolicy :: (HasCallStack, MonadIO m, IsViewSwitcher a) => a -> ViewSwitcherPolicy -> m ()
- viewSwitcherSetStack :: (HasCallStack, MonadIO m, IsViewSwitcher a, IsViewStack b) => a -> Maybe b -> m ()
- constructViewSwitcherPolicy :: (IsViewSwitcher o, MonadIO m) => ViewSwitcherPolicy -> m (GValueConstruct o)
- getViewSwitcherPolicy :: (MonadIO m, IsViewSwitcher o) => o -> m ViewSwitcherPolicy
- setViewSwitcherPolicy :: (MonadIO m, IsViewSwitcher o) => o -> ViewSwitcherPolicy -> m ()
- clearViewSwitcherStack :: (MonadIO m, IsViewSwitcher o) => o -> m ()
- constructViewSwitcherStack :: (IsViewSwitcher o, MonadIO m, IsViewStack a) => a -> m (GValueConstruct o)
- getViewSwitcherStack :: (MonadIO m, IsViewSwitcher o) => o -> m (Maybe ViewStack)
- setViewSwitcherStack :: (MonadIO m, IsViewSwitcher o, IsViewStack a) => o -> a -> m ()
Exported types
newtype ViewSwitcher Source #
Memory-managed wrapper type.
Constructors
ViewSwitcher (ManagedPtr ViewSwitcher) |
Instances
Eq ViewSwitcher Source # | |
Defined in GI.Adw.Objects.ViewSwitcher | |
GObject ViewSwitcher Source # | |
Defined in GI.Adw.Objects.ViewSwitcher | |
ManagedPtrNewtype ViewSwitcher Source # | |
Defined in GI.Adw.Objects.ViewSwitcher Methods toManagedPtr :: ViewSwitcher -> ManagedPtr ViewSwitcher | |
TypedObject ViewSwitcher Source # | |
Defined in GI.Adw.Objects.ViewSwitcher | |
HasParentTypes ViewSwitcher Source # | |
Defined in GI.Adw.Objects.ViewSwitcher | |
IsGValue (Maybe ViewSwitcher) Source # | Convert |
Defined in GI.Adw.Objects.ViewSwitcher Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe ViewSwitcher -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe ViewSwitcher) | |
type ParentTypes ViewSwitcher Source # | |
Defined in GI.Adw.Objects.ViewSwitcher type ParentTypes ViewSwitcher = '[Widget, Object, Accessible, Buildable, ConstraintTarget] |
class (GObject o, IsDescendantOf ViewSwitcher o) => IsViewSwitcher o Source #
Type class for types which can be safely cast to ViewSwitcher
, for instance with toViewSwitcher
.
Instances
(GObject o, IsDescendantOf ViewSwitcher o) => IsViewSwitcher o Source # | |
Defined in GI.Adw.Objects.ViewSwitcher |
toViewSwitcher :: (MonadIO m, IsViewSwitcher o) => o -> m ViewSwitcher Source #
Cast to ViewSwitcher
, 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, 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, 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, getPolicy, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStack, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, 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, setPolicy, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStack, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.
getPolicy
viewSwitcherGetPolicy Source #
Arguments
:: (HasCallStack, MonadIO m, IsViewSwitcher a) | |
=> a |
|
-> m ViewSwitcherPolicy | Returns: the policy of |
Gets the policy of self
.
getStack
Arguments
:: (HasCallStack, MonadIO m, IsViewSwitcher a) | |
=> a |
|
-> m (Maybe ViewStack) | Returns: the stack |
Gets the stack controlled by self
.
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> m ViewSwitcher | Returns: the newly created |
Creates a new AdwViewSwitcher
.
setPolicy
viewSwitcherSetPolicy Source #
Arguments
:: (HasCallStack, MonadIO m, IsViewSwitcher a) | |
=> a |
|
-> ViewSwitcherPolicy |
|
-> m () |
Sets the policy of self
.
setStack
Arguments
:: (HasCallStack, MonadIO m, IsViewSwitcher a, IsViewStack b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the stack controlled by self
.
Properties
policy
The policy to determine which mode to use.
constructViewSwitcherPolicy :: (IsViewSwitcher 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
.
getViewSwitcherPolicy :: (MonadIO m, IsViewSwitcher o) => o -> m ViewSwitcherPolicy Source #
Get the value of the “policy
” property.
When overloading is enabled, this is equivalent to
get
viewSwitcher #policy
setViewSwitcherPolicy :: (MonadIO m, IsViewSwitcher o) => o -> ViewSwitcherPolicy -> m () Source #
Set the value of the “policy
” property.
When overloading is enabled, this is equivalent to
set
viewSwitcher [ #policy:=
value ]
stack
The stack the view switcher controls.
clearViewSwitcherStack :: (MonadIO m, IsViewSwitcher o) => o -> m () Source #
Set the value of the “stack
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#stack
constructViewSwitcherStack :: (IsViewSwitcher 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
.
getViewSwitcherStack :: (MonadIO m, IsViewSwitcher o) => o -> m (Maybe ViewStack) Source #
Get the value of the “stack
” property.
When overloading is enabled, this is equivalent to
get
viewSwitcher #stack
setViewSwitcherStack :: (MonadIO m, IsViewSwitcher o, IsViewStack a) => o -> a -> m () Source #
Set the value of the “stack
” property.
When overloading is enabled, this is equivalent to
set
viewSwitcher [ #stack:=
value ]