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.NavigationSplitView

Description

A widget presenting sidebar and content side by side or as a navigation view.

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

AdwNavigationSplitView has two [classnavigationPage] children: sidebar and content, and displays them side by side.

When [propertynavigationSplitView:collapsed] is set to TRUE, it instead puts both children inside an [classnavigationView]. The [propertynavigationSplitView:show-content] controls which child is visible while collapsed.

See also [classoverlaySplitView].

AdwNavigationSplitView is typically used together with an [classbreakpoint] setting the collapsed property to TRUE on small widths, as follows:

xml code

<object class="AdwWindow">
  <property name="width-request">280</property>
  <property name="height-request">200</property>
  <property name="default-width">800</property>
  <property name="default-height">800</property>
  <child>
    <object class="AdwBreakpoint">
      <condition>max-width: 400sp</condition>
      <setter object="split_view" property="collapsed">True</setter>
    </object>
  </child>
  <property name="content">
    <object class="AdwNavigationSplitView" id="split_view">
      <property name="sidebar">
        <object class="AdwNavigationPage">
          <property name="title" translatable="yes">Sidebar</property>
          <property name="child">
            <!-- ... -->
          </property>
        </object>
      </property>
      <property name="content">
        <object class="AdwNavigationPage">
          <property name="title" translatable="yes">Content</property>
          <property name="child">
            <!-- ... -->
          </property>
        </object>
      </property>
    </object>
  </property>
</object>

Sizing

When not collapsed, AdwNavigationSplitView changes the sidebar width depending on its own width.

If possible, it tries to allocate a fraction of the total width, controlled with the [propertynavigationSplitView:sidebar-width-fraction] property.

The sidebar also has minimum and maximum sizes, controlled with the [propertynavigationSplitView:min-sidebar-width] and [propertynavigationSplitView:max-sidebar-width] properties.

The minimum and maximum sizes are using the length unit specified with the [propertynavigationSplitView:sidebar-width-unit].

By default, sidebar is using 25% of the total width, with 180sp as the minimum size and 280sp as the maximum size.

Header Bar Integration

When used inside AdwNavigationSplitView, [classheaderBar] will automatically hide the window buttons in the middle.

When collapsed, it also displays a back button for the content widget, as well as the page titles. See [classnavigationView] documentation for details.

Actions

AdwNavigationSplitView defines the same actions as AdwNavigationView, but they can be used even when the split view is not collapsed:

  • navigation.push takes a string parameter specifying the tag of the page

to push. If it matches the tag of the content widget, it sets [propertynavigationSplitView:show-content] to TRUE.

  • navigation.pop doesn't take any parameters and sets
propertynavigationSplitView:show-content
to FALSE.

AdwNavigationSplitView as GtkBuildable

The AdwNavigationSplitView implementation of the Buildable interface supports setting the sidebar widget by specifying “sidebar” as the “type” attribute of a <child> element, Specifying “content” child type or omitting it results in setting the content widget.

CSS nodes

AdwNavigationSplitView has a single CSS node with the name navigation-split-view.

When collapsed, it contains a child node with the name navigation-view containing both children.

navigation-split-view
╰── navigation-view
    ├── [sidebar child]
    ╰── [content child]

When not collapsed, it contains two nodes with the name widget, one with the .sidebar-pane style class, the other one with .content-view style class, containing the sidebar and content children respectively.

navigation-split-view
├── widget.sidebar-pane
│   ╰── [sidebar child]
╰── widget.content-pane
    ╰── [content child]

Accessibility

AdwNavigationSplitView uses the GTK_ACCESSIBLE_ROLE_GROUP role.

Since: 1.4

Synopsis

Exported types

newtype NavigationSplitView Source #

Memory-managed wrapper type.

Constructors

NavigationSplitView (ManagedPtr NavigationSplitView) 

Instances

Instances details
Eq NavigationSplitView Source # 
Instance details

Defined in GI.Adw.Objects.NavigationSplitView

GObject NavigationSplitView Source # 
Instance details

Defined in GI.Adw.Objects.NavigationSplitView

ManagedPtrNewtype NavigationSplitView Source # 
Instance details

Defined in GI.Adw.Objects.NavigationSplitView

TypedObject NavigationSplitView Source # 
Instance details

Defined in GI.Adw.Objects.NavigationSplitView

Methods

glibType :: IO GType

HasParentTypes NavigationSplitView Source # 
Instance details

Defined in GI.Adw.Objects.NavigationSplitView

IsGValue (Maybe NavigationSplitView) Source #

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

Instance details

Defined in GI.Adw.Objects.NavigationSplitView

type ParentTypes NavigationSplitView Source # 
Instance details

Defined in GI.Adw.Objects.NavigationSplitView

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

class (GObject o, IsDescendantOf NavigationSplitView o) => IsNavigationSplitView o Source #

Type class for types which can be safely cast to NavigationSplitView, for instance with toNavigationSplitView.

Instances

Instances details
(GObject o, IsDescendantOf NavigationSplitView o) => IsNavigationSplitView o Source # 
Instance details

Defined in GI.Adw.Objects.NavigationSplitView

toNavigationSplitView :: (MonadIO m, IsNavigationSplitView o) => o -> m NavigationSplitView Source #

Cast to NavigationSplitView, 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, getCollapsed, getColor, getContent, 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, getMaxSidebarWidth, getMinSidebarWidth, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getShowContent, getSidebar, getSidebarWidthFraction, getSidebarWidthUnit, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

Setters

setAccessibleParent, setCanFocus, setCanTarget, setChildVisible, setCollapsed, setContent, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setMaxSidebarWidth, setMinSidebarWidth, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setShowContent, setSidebar, setSidebarWidthFraction, setSidebarWidthUnit, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

getCollapsed

navigationSplitViewGetCollapsed Source #

Arguments

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

self: a navigation split view

-> m Bool

Returns: whether self is collapsed

Gets whether self is collapsed.

Since: 1.4

getContent

navigationSplitViewGetContent Source #

Arguments

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

self: a navigation split view

-> m (Maybe NavigationPage)

Returns: the content widget

Sets the content widget for self.

Since: 1.4

getMaxSidebarWidth

navigationSplitViewGetMaxSidebarWidth Source #

Arguments

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

self: a navigation split view

-> m Double

Returns: the maximum width

Gets the maximum sidebar width for self.

Since: 1.4

getMinSidebarWidth

navigationSplitViewGetMinSidebarWidth Source #

Arguments

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

self: a navigation split view

-> m Double

Returns: the minimum width

Gets the minimum sidebar width for self.

Since: 1.4

getShowContent

navigationSplitViewGetShowContent Source #

Arguments

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

self: a navigation split view

-> m Bool

Returns: whether to show content when collapsed

Gets which page is visible when self is collapsed.

Since: 1.4

getSidebar

navigationSplitViewGetSidebar Source #

Arguments

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

self: a navigation split view

-> m (Maybe NavigationPage)

Returns: the sidebar widget

Gets the sidebar widget for self.

Since: 1.4

getSidebarWidthFraction

navigationSplitViewGetSidebarWidthFraction Source #

Arguments

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

self: a navigation split view

-> m Double

Returns: the preferred width fraction

Gets the preferred sidebar width fraction for self.

Since: 1.4

getSidebarWidthUnit

navigationSplitViewGetSidebarWidthUnit Source #

Arguments

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

self: a navigation split view

-> m LengthUnit

Returns: the length unit

Gets the length unit for minimum and maximum sidebar widths.

Since: 1.4

new

navigationSplitViewNew Source #

Arguments

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

Returns: the newly created AdwNavigationSplitView

Creates a new AdwNavigationSplitView.

Since: 1.4

setCollapsed

navigationSplitViewSetCollapsed Source #

Arguments

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

self: a navigation split view

-> Bool

collapsed: whether self is collapsed

-> m () 

Sets whether self is collapsed.

When collapsed, the children are put inside an [classnavigationView], otherwise they are displayed side by side.

The [propertynavigationSplitView:show-content] controls which child is visible while collapsed.

Since: 1.4

setContent

navigationSplitViewSetContent Source #

Arguments

:: (HasCallStack, MonadIO m, IsNavigationSplitView a, IsNavigationPage b) 
=> a

self: a navigation split view

-> Maybe b

content: the content widget

-> m () 

Sets the content widget for self.

Since: 1.4

setMaxSidebarWidth

navigationSplitViewSetMaxSidebarWidth Source #

Arguments

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

self: a navigation split view

-> Double

width: the maximum width

-> m () 

Sets the maximum sidebar width for self.

Maximum width is affected by [propertynavigationSplitView:sidebar-width-unit].

The sidebar widget can still be allocated with larger width if its own minimum width exceeds it.

Since: 1.4

setMinSidebarWidth

navigationSplitViewSetMinSidebarWidth Source #

Arguments

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

self: a navigation split view

-> Double

width: the minimum width

-> m () 

Sets the minimum sidebar width for self.

Minimum width is affected by [propertynavigationSplitView:sidebar-width-unit].

The sidebar widget can still be allocated with larger width if its own minimum width exceeds it.

Since: 1.4

setShowContent

navigationSplitViewSetShowContent Source #

Arguments

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

self: a navigation split view

-> Bool

showContent: whether to show content when collapsed

-> m () 

Sets which page is visible when self is collapsed.

If set to TRUE, the content widget will be the visible page when [propertynavigationSplitView:collapsed] is TRUE; otherwise the sidebar widget will be visible.

If the split view is already collapsed, the visible page changes immediately.

Since: 1.4

setSidebar

navigationSplitViewSetSidebar Source #

Arguments

:: (HasCallStack, MonadIO m, IsNavigationSplitView a, IsNavigationPage b) 
=> a

self: a navigation split view

-> Maybe b

sidebar: the sidebar widget

-> m () 

Sets the sidebar widget for self.

Since: 1.4

setSidebarWidthFraction

navigationSplitViewSetSidebarWidthFraction Source #

Arguments

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

self: a navigation split view

-> Double

fraction: the preferred width fraction

-> m () 

Sets the preferred sidebar width as a fraction of the total width of self.

The preferred width is additionally limited by [propertynavigationSplitView:min-sidebar-width] and [propertynavigationSplitView:max-sidebar-width].

The sidebar widget can be allocated with larger width if its own minimum width exceeds the preferred width.

Since: 1.4

setSidebarWidthUnit

navigationSplitViewSetSidebarWidthUnit Source #

Arguments

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

self: a navigation split view

-> LengthUnit

unit: the length unit

-> m () 

Sets the length unit for minimum and maximum sidebar widths.

See [propertynavigationSplitView:min-sidebar-width] and [propertynavigationSplitView:max-sidebar-width].

Since: 1.4

Properties

collapsed

Whether the split view is collapsed.

When collapsed, the children are put inside an [classnavigationView], otherwise they are displayed side by side.

The [propertynavigationSplitView:show-content] controls which child is visible while collapsed.

Since: 1.4

constructNavigationSplitViewCollapsed :: (IsNavigationSplitView o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getNavigationSplitViewCollapsed :: (MonadIO m, IsNavigationSplitView o) => o -> m Bool Source #

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

get navigationSplitView #collapsed

setNavigationSplitViewCollapsed :: (MonadIO m, IsNavigationSplitView o) => o -> Bool -> m () Source #

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

set navigationSplitView [ #collapsed := value ]

content

The content widget.

Since: 1.4

clearNavigationSplitViewContent :: (MonadIO m, IsNavigationSplitView o) => o -> m () Source #

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

clear #content

constructNavigationSplitViewContent :: (IsNavigationSplitView o, MonadIO m, IsNavigationPage a) => a -> m (GValueConstruct o) Source #

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

getNavigationSplitViewContent :: (MonadIO m, IsNavigationSplitView o) => o -> m (Maybe NavigationPage) Source #

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

get navigationSplitView #content

setNavigationSplitViewContent :: (MonadIO m, IsNavigationSplitView o, IsNavigationPage a) => o -> a -> m () Source #

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

set navigationSplitView [ #content := value ]

maxSidebarWidth

The maximum sidebar width.

Maximum width is affected by [propertynavigationSplitView:sidebar-width-unit].

The sidebar widget can still be allocated with larger width if its own minimum width exceeds it.

Since: 1.4

constructNavigationSplitViewMaxSidebarWidth :: (IsNavigationSplitView o, MonadIO m) => Double -> m (GValueConstruct o) Source #

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

getNavigationSplitViewMaxSidebarWidth :: (MonadIO m, IsNavigationSplitView o) => o -> m Double Source #

Get the value of the “max-sidebar-width” property. When overloading is enabled, this is equivalent to

get navigationSplitView #maxSidebarWidth

setNavigationSplitViewMaxSidebarWidth :: (MonadIO m, IsNavigationSplitView o) => o -> Double -> m () Source #

Set the value of the “max-sidebar-width” property. When overloading is enabled, this is equivalent to

set navigationSplitView [ #maxSidebarWidth := value ]

minSidebarWidth

The minimum sidebar width.

Minimum width is affected by [propertynavigationSplitView:sidebar-width-unit].

The sidebar widget can still be allocated with larger width if its own minimum width exceeds it.

Since: 1.4

constructNavigationSplitViewMinSidebarWidth :: (IsNavigationSplitView o, MonadIO m) => Double -> m (GValueConstruct o) Source #

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

getNavigationSplitViewMinSidebarWidth :: (MonadIO m, IsNavigationSplitView o) => o -> m Double Source #

Get the value of the “min-sidebar-width” property. When overloading is enabled, this is equivalent to

get navigationSplitView #minSidebarWidth

setNavigationSplitViewMinSidebarWidth :: (MonadIO m, IsNavigationSplitView o) => o -> Double -> m () Source #

Set the value of the “min-sidebar-width” property. When overloading is enabled, this is equivalent to

set navigationSplitView [ #minSidebarWidth := value ]

showContent

Determines the visible page when collapsed.

If set to TRUE, the content widget will be the visible page when [propertynavigationSplitView:collapsed] is TRUE; otherwise the sidebar widget will be visible.

If the split view is already collapsed, the visible page changes immediately.

Since: 1.4

constructNavigationSplitViewShowContent :: (IsNavigationSplitView o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getNavigationSplitViewShowContent :: (MonadIO m, IsNavigationSplitView o) => o -> m Bool Source #

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

get navigationSplitView #showContent

setNavigationSplitViewShowContent :: (MonadIO m, IsNavigationSplitView o) => o -> Bool -> m () Source #

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

set navigationSplitView [ #showContent := value ]

sidebar

The sidebar widget.

Since: 1.4

clearNavigationSplitViewSidebar :: (MonadIO m, IsNavigationSplitView o) => o -> m () Source #

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

clear #sidebar

constructNavigationSplitViewSidebar :: (IsNavigationSplitView o, MonadIO m, IsNavigationPage a) => a -> m (GValueConstruct o) Source #

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

getNavigationSplitViewSidebar :: (MonadIO m, IsNavigationSplitView o) => o -> m (Maybe NavigationPage) Source #

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

get navigationSplitView #sidebar

setNavigationSplitViewSidebar :: (MonadIO m, IsNavigationSplitView o, IsNavigationPage a) => o -> a -> m () Source #

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

set navigationSplitView [ #sidebar := value ]

sidebarWidthFraction

The preferred sidebar width as a fraction of the total width.

The preferred width is additionally limited by [propertynavigationSplitView:min-sidebar-width] and [propertynavigationSplitView:max-sidebar-width].

The sidebar widget can be allocated with larger width if its own minimum width exceeds the preferred width.

Since: 1.4

constructNavigationSplitViewSidebarWidthFraction :: (IsNavigationSplitView o, MonadIO m) => Double -> m (GValueConstruct o) Source #

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

getNavigationSplitViewSidebarWidthFraction :: (MonadIO m, IsNavigationSplitView o) => o -> m Double Source #

Get the value of the “sidebar-width-fraction” property. When overloading is enabled, this is equivalent to

get navigationSplitView #sidebarWidthFraction

setNavigationSplitViewSidebarWidthFraction :: (MonadIO m, IsNavigationSplitView o) => o -> Double -> m () Source #

Set the value of the “sidebar-width-fraction” property. When overloading is enabled, this is equivalent to

set navigationSplitView [ #sidebarWidthFraction := value ]

sidebarWidthUnit

The length unit for minimum and maximum sidebar widths.

See [propertynavigationSplitView:min-sidebar-width] and [propertynavigationSplitView:max-sidebar-width].

Since: 1.4

constructNavigationSplitViewSidebarWidthUnit :: (IsNavigationSplitView o, MonadIO m) => LengthUnit -> m (GValueConstruct o) Source #

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

getNavigationSplitViewSidebarWidthUnit :: (MonadIO m, IsNavigationSplitView o) => o -> m LengthUnit Source #

Get the value of the “sidebar-width-unit” property. When overloading is enabled, this is equivalent to

get navigationSplitView #sidebarWidthUnit

setNavigationSplitViewSidebarWidthUnit :: (MonadIO m, IsNavigationSplitView o) => o -> LengthUnit -> m () Source #

Set the value of the “sidebar-width-unit” property. When overloading is enabled, this is equivalent to

set navigationSplitView [ #sidebarWidthUnit := value ]