gi-adwaita-1.0.3: 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.HeaderBar

Description

A title bar widget.

<picture> <source srcset="header-bar-dark.png" media="(prefers-color-scheme: dark)"> <img src="header-bar.png" alt="header-bar"> </picture>

AdwHeaderBar is similar to HeaderBar, but provides additional features compared to it. Refer to GtkHeaderBar for details.

propertyheaderBar:centering-policy
allows to enforce strict centering of the title widget, this is useful for [classviewSwitcherTitle].
propertyheaderBar:show-start-title-buttons
and
propertyheaderBar:show-end-title-buttons
allow to easily create split header bar layouts using [classleaflet], as follows:

xml code

<object class="AdwLeaflet" id="leaflet">
  <child>
    <object class="GtkBox">
      <property name="orientation">vertical</property>
      <child>
        <object class="AdwHeaderBar">
          <binding name="show-end-title-buttons">
            <lookup name="folded">leaflet</lookup>
          </binding>
        </object>
      </child>
      <!-- ... -->
    </object>
  </child>
  <!-- ... -->
  <child>
    <object class="GtkBox">
      <property name="orientation">vertical</property>
      <property name="hexpand">True</property>
      <child>
        <object class="AdwHeaderBar">
          <binding name="show-start-title-buttons">
            <lookup name="folded">leaflet</lookup>
          </binding>
        </object>
      </child>
      <!-- ... -->
    </object>
  </child>
</object>

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

CSS nodes

headerbar
╰── windowhandle
    ╰── box
        ├── widget
        │   ╰── box.start
        │       ├── windowcontrols.start
        │       ╰── [other children]
        ├── [Title Widget]
        ╰── widget
            ╰── box.end
                ├── [other children]
                ╰── windowcontrols.end

AdwHeaderBar's CSS node is called headerbar. It contains a windowhandle subnode, which contains a box subnode, which contains two widget subnodes at the start and end of the header bar, each of which contains a box subnode with the .start and .end style classes respectively, as well as a center node that represents the title.

Each of the boxes contains a windowcontrols subnode, see WindowControls for details, as well as other children.

Accessibility

AdwHeaderBar uses the GTK_ACCESSIBLE_ROLE_GROUP role.

Since: 1.0

Synopsis

Exported types

newtype HeaderBar Source #

Memory-managed wrapper type.

Constructors

HeaderBar (ManagedPtr HeaderBar) 

Instances

Instances details
Eq HeaderBar Source # 
Instance details

Defined in GI.Adw.Objects.HeaderBar

GObject HeaderBar Source # 
Instance details

Defined in GI.Adw.Objects.HeaderBar

ManagedPtrNewtype HeaderBar Source # 
Instance details

Defined in GI.Adw.Objects.HeaderBar

Methods

toManagedPtr :: HeaderBar -> ManagedPtr HeaderBar

TypedObject HeaderBar Source # 
Instance details

Defined in GI.Adw.Objects.HeaderBar

Methods

glibType :: IO GType

HasParentTypes HeaderBar Source # 
Instance details

Defined in GI.Adw.Objects.HeaderBar

IsGValue (Maybe HeaderBar) Source #

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

Instance details

Defined in GI.Adw.Objects.HeaderBar

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe HeaderBar -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe HeaderBar)

type ParentTypes HeaderBar Source # 
Instance details

Defined in GI.Adw.Objects.HeaderBar

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

class (GObject o, IsDescendantOf HeaderBar o) => IsHeaderBar o Source #

Type class for types which can be safely cast to HeaderBar, for instance with toHeaderBar.

Instances

Instances details
(GObject o, IsDescendantOf HeaderBar o) => IsHeaderBar o Source # 
Instance details

Defined in GI.Adw.Objects.HeaderBar

toHeaderBar :: (MonadIO m, IsHeaderBar o) => o -> m HeaderBar Source #

Cast to HeaderBar, 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, 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, packEnd, packStart, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, remove, 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, getCenteringPolicy, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDecorationLayout, 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, getShowEndTitleButtons, getShowStartTitleButtons, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTitleWidget, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

Setters

setCanFocus, setCanTarget, setCenteringPolicy, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDecorationLayout, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setShowEndTitleButtons, setShowStartTitleButtons, setSizeRequest, setStateFlags, setTitleWidget, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

getCenteringPolicy

headerBarGetCenteringPolicy Source #

Arguments

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

self: a header bar

-> m CenteringPolicy

Returns: the centering policy

Gets the policy for aligning the center widget.

Since: 1.0

getDecorationLayout

headerBarGetDecorationLayout Source #

Arguments

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

self: a header bar

-> m (Maybe Text)

Returns: the decoration layout

Gets the decoration layout for self.

Since: 1.0

getShowEndTitleButtons

headerBarGetShowEndTitleButtons Source #

Arguments

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

self: a header bar

-> m Bool

Returns: TRUE if title buttons at the end are shown

Gets whether to show title buttons at the end of self.

Since: 1.0

getShowStartTitleButtons

headerBarGetShowStartTitleButtons Source #

Arguments

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

self: a header bar

-> m Bool

Returns: TRUE if title buttons at the start are shown

Gets whether to show title buttons at the start of self.

Since: 1.0

getTitleWidget

headerBarGetTitleWidget Source #

Arguments

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

self: a header bar

-> m (Maybe Widget)

Returns: the title widget

Gets the title widget widget of self.

Since: 1.0

new

headerBarNew Source #

Arguments

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

Returns: the newly created AdwHeaderBar.

Creates a new AdwHeaderBar.

Since: 1.0

packEnd

headerBarPackEnd Source #

Arguments

:: (HasCallStack, MonadIO m, IsHeaderBar a, IsWidget b) 
=> a

self: a header bar

-> b

child: the widget to be added to self

-> m () 

Adds child to self, packed with reference to the end of self.

Since: 1.0

packStart

headerBarPackStart Source #

Arguments

:: (HasCallStack, MonadIO m, IsHeaderBar a, IsWidget b) 
=> a

self: a header bar

-> b

child: the widget to be added to self

-> m () 

Adds child to self, packed with reference to the start of the self.

Since: 1.0

remove

headerBarRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsHeaderBar a, IsWidget b) 
=> a

self: a header bar

-> b

child: the child to remove

-> m () 

Removes a child from self.

The child must have been added with [methodheaderBar.pack_start], [methodheaderBar.pack_end] or [propertyheaderBar:title-widget].

Since: 1.0

setCenteringPolicy

headerBarSetCenteringPolicy Source #

Arguments

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

self: a header bar

-> CenteringPolicy

centeringPolicy: the centering policy

-> m () 

Sets the policy for aligning the center widget.

Since: 1.0

setDecorationLayout

headerBarSetDecorationLayout Source #

Arguments

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

self: a header bar

-> Maybe Text

layout: a decoration layout

-> m () 

Sets the decoration layout for self.

If this property is not set, the Settings:gtkDecorationLayout setting is used.

The format of the string is button names, separated by commas. A colon separates the buttons that should appear at the start from those at the end. Recognized button names are minimize, maximize, close and icon (the window icon).

For example, “icon:minimize,maximize,close” specifies an icon at the start, and minimize, maximize and close buttons at the end.

Since: 1.0

setShowEndTitleButtons

headerBarSetShowEndTitleButtons Source #

Arguments

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

self: a header bar

-> Bool

setting: TRUE to show standard title buttons

-> m () 

Sets whether to show title buttons at the end of self.

See [propertyheaderBar:show-start-title-buttons] for the other side.

Which buttons are actually shown and where is determined by the [propertyheaderBar:decoration-layout] property, and by the state of the window (e.g. a close button will not be shown if the window can't be closed).

Since: 1.0

setShowStartTitleButtons

headerBarSetShowStartTitleButtons Source #

Arguments

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

self: a header bar

-> Bool

setting: TRUE to show standard title buttons

-> m () 

Sets whether to show title buttons at the start of self.

See [propertyheaderBar:show-end-title-buttons] for the other side.

Which buttons are actually shown and where is determined by the [propertyheaderBar:decoration-layout] property, and by the state of the window (e.g. a close button will not be shown if the window can't be closed).

Since: 1.0

setTitleWidget

headerBarSetTitleWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsHeaderBar a, IsWidget b) 
=> a

self: a header bar

-> Maybe b

titleWidget: a widget to use for a title

-> m () 

Sets the title widget for self.

When set to NULL, the header bar will display the title of the window it is contained in.

To use a different title, use [classwindowTitle]:

xml code

<object class="AdwHeaderBar">
  <property name="title-widget">
    <object class="AdwWindowTitle">
      <property name="title" translatable="yes">Title</property>
    </object>
  </property>
</object>

Since: 1.0

Properties

centeringPolicy

The policy for aligning the center widget.

Since: 1.0

constructHeaderBarCenteringPolicy :: (IsHeaderBar o, MonadIO m) => CenteringPolicy -> m (GValueConstruct o) Source #

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

getHeaderBarCenteringPolicy :: (MonadIO m, IsHeaderBar o) => o -> m CenteringPolicy Source #

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

get headerBar #centeringPolicy

setHeaderBarCenteringPolicy :: (MonadIO m, IsHeaderBar o) => o -> CenteringPolicy -> m () Source #

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

set headerBar [ #centeringPolicy := value ]

decorationLayout

The decoration layout for buttons.

If this property is not set, the Settings:gtkDecorationLayout setting is used.

The format of the string is button names, separated by commas. A colon separates the buttons that should appear at the start from those at the end. Recognized button names are minimize, maximize, close and icon (the window icon).

For example, “icon:minimize,maximize,close” specifies an icon at the start, and minimize, maximize and close buttons at the end.

Since: 1.0

clearHeaderBarDecorationLayout :: (MonadIO m, IsHeaderBar o) => o -> m () Source #

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

clear #decorationLayout

constructHeaderBarDecorationLayout :: (IsHeaderBar o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getHeaderBarDecorationLayout :: (MonadIO m, IsHeaderBar o) => o -> m (Maybe Text) Source #

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

get headerBar #decorationLayout

setHeaderBarDecorationLayout :: (MonadIO m, IsHeaderBar o) => o -> Text -> m () Source #

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

set headerBar [ #decorationLayout := value ]

showEndTitleButtons

Whether to show title buttons at the end of the header bar.

See [propertyheaderBar:show-start-title-buttons] for the other side.

Which buttons are actually shown and where is determined by the [propertyheaderBar:decoration-layout] property, and by the state of the window (e.g. a close button will not be shown if the window can't be closed).

Since: 1.0

constructHeaderBarShowEndTitleButtons :: (IsHeaderBar o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getHeaderBarShowEndTitleButtons :: (MonadIO m, IsHeaderBar o) => o -> m Bool Source #

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

get headerBar #showEndTitleButtons

setHeaderBarShowEndTitleButtons :: (MonadIO m, IsHeaderBar o) => o -> Bool -> m () Source #

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

set headerBar [ #showEndTitleButtons := value ]

showStartTitleButtons

Whether to show title buttons at the start of the header bar.

See [propertyheaderBar:show-end-title-buttons] for the other side.

Which buttons are actually shown and where is determined by the [propertyheaderBar:decoration-layout] property, and by the state of the window (e.g. a close button will not be shown if the window can't be closed).

Since: 1.0

constructHeaderBarShowStartTitleButtons :: (IsHeaderBar o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getHeaderBarShowStartTitleButtons :: (MonadIO m, IsHeaderBar o) => o -> m Bool Source #

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

get headerBar #showStartTitleButtons

setHeaderBarShowStartTitleButtons :: (MonadIO m, IsHeaderBar o) => o -> Bool -> m () Source #

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

set headerBar [ #showStartTitleButtons := value ]

titleWidget

The title widget to display.

When set to NULL, the header bar will display the title of the window it is contained in.

To use a different title, use [classwindowTitle]:

xml code

<object class="AdwHeaderBar">
  <property name="title-widget">
    <object class="AdwWindowTitle">
      <property name="title" translatable="yes">Title</property>
    </object>
  </property>
</object>

Since: 1.0

clearHeaderBarTitleWidget :: (MonadIO m, IsHeaderBar o) => o -> m () Source #

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

clear #titleWidget

constructHeaderBarTitleWidget :: (IsHeaderBar o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

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

getHeaderBarTitleWidget :: (MonadIO m, IsHeaderBar o) => o -> m (Maybe Widget) Source #

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

get headerBar #titleWidget

setHeaderBarTitleWidget :: (MonadIO m, IsHeaderBar o, IsWidget a) => o -> a -> m () Source #

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

set headerBar [ #titleWidget := value ]