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 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.
- property
headerBar
:centering-policy - allows to enforce strict centering of
the title widget, this is useful for [class
viewSwitcherTitle
]. - property
headerBar
:show-start-title-buttons - and
- property
headerBar
:show-end-title-buttons - allow to easily create split
header bar layouts using [class
leaflet
], 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
- newtype HeaderBar = HeaderBar (ManagedPtr HeaderBar)
- class (GObject o, IsDescendantOf HeaderBar o) => IsHeaderBar o
- toHeaderBar :: (MonadIO m, IsHeaderBar o) => o -> m HeaderBar
- headerBarGetCenteringPolicy :: (HasCallStack, MonadIO m, IsHeaderBar a) => a -> m CenteringPolicy
- headerBarGetDecorationLayout :: (HasCallStack, MonadIO m, IsHeaderBar a) => a -> m (Maybe Text)
- headerBarGetShowEndTitleButtons :: (HasCallStack, MonadIO m, IsHeaderBar a) => a -> m Bool
- headerBarGetShowStartTitleButtons :: (HasCallStack, MonadIO m, IsHeaderBar a) => a -> m Bool
- headerBarGetTitleWidget :: (HasCallStack, MonadIO m, IsHeaderBar a) => a -> m (Maybe Widget)
- headerBarNew :: (HasCallStack, MonadIO m) => m HeaderBar
- headerBarPackEnd :: (HasCallStack, MonadIO m, IsHeaderBar a, IsWidget b) => a -> b -> m ()
- headerBarPackStart :: (HasCallStack, MonadIO m, IsHeaderBar a, IsWidget b) => a -> b -> m ()
- headerBarRemove :: (HasCallStack, MonadIO m, IsHeaderBar a, IsWidget b) => a -> b -> m ()
- headerBarSetCenteringPolicy :: (HasCallStack, MonadIO m, IsHeaderBar a) => a -> CenteringPolicy -> m ()
- headerBarSetDecorationLayout :: (HasCallStack, MonadIO m, IsHeaderBar a) => a -> Maybe Text -> m ()
- headerBarSetShowEndTitleButtons :: (HasCallStack, MonadIO m, IsHeaderBar a) => a -> Bool -> m ()
- headerBarSetShowStartTitleButtons :: (HasCallStack, MonadIO m, IsHeaderBar a) => a -> Bool -> m ()
- headerBarSetTitleWidget :: (HasCallStack, MonadIO m, IsHeaderBar a, IsWidget b) => a -> Maybe b -> m ()
- constructHeaderBarCenteringPolicy :: (IsHeaderBar o, MonadIO m) => CenteringPolicy -> m (GValueConstruct o)
- getHeaderBarCenteringPolicy :: (MonadIO m, IsHeaderBar o) => o -> m CenteringPolicy
- setHeaderBarCenteringPolicy :: (MonadIO m, IsHeaderBar o) => o -> CenteringPolicy -> m ()
- clearHeaderBarDecorationLayout :: (MonadIO m, IsHeaderBar o) => o -> m ()
- constructHeaderBarDecorationLayout :: (IsHeaderBar o, MonadIO m) => Text -> m (GValueConstruct o)
- getHeaderBarDecorationLayout :: (MonadIO m, IsHeaderBar o) => o -> m (Maybe Text)
- setHeaderBarDecorationLayout :: (MonadIO m, IsHeaderBar o) => o -> Text -> m ()
- constructHeaderBarShowEndTitleButtons :: (IsHeaderBar o, MonadIO m) => Bool -> m (GValueConstruct o)
- getHeaderBarShowEndTitleButtons :: (MonadIO m, IsHeaderBar o) => o -> m Bool
- setHeaderBarShowEndTitleButtons :: (MonadIO m, IsHeaderBar o) => o -> Bool -> m ()
- constructHeaderBarShowStartTitleButtons :: (IsHeaderBar o, MonadIO m) => Bool -> m (GValueConstruct o)
- getHeaderBarShowStartTitleButtons :: (MonadIO m, IsHeaderBar o) => o -> m Bool
- setHeaderBarShowStartTitleButtons :: (MonadIO m, IsHeaderBar o) => o -> Bool -> m ()
- clearHeaderBarTitleWidget :: (MonadIO m, IsHeaderBar o) => o -> m ()
- constructHeaderBarTitleWidget :: (IsHeaderBar o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getHeaderBarTitleWidget :: (MonadIO m, IsHeaderBar o) => o -> m (Maybe Widget)
- setHeaderBarTitleWidget :: (MonadIO m, IsHeaderBar o, IsWidget a) => o -> a -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq HeaderBar Source # | |
GObject HeaderBar Source # | |
Defined in GI.Adw.Objects.HeaderBar | |
ManagedPtrNewtype HeaderBar Source # | |
Defined in GI.Adw.Objects.HeaderBar toManagedPtr :: HeaderBar -> ManagedPtr HeaderBar | |
TypedObject HeaderBar Source # | |
Defined in GI.Adw.Objects.HeaderBar | |
HasParentTypes HeaderBar Source # | |
Defined in GI.Adw.Objects.HeaderBar | |
IsGValue (Maybe HeaderBar) Source # | Convert |
Defined in GI.Adw.Objects.HeaderBar gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe HeaderBar -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe HeaderBar) | |
type ParentTypes HeaderBar Source # | |
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
(GObject o, IsDescendantOf HeaderBar o) => IsHeaderBar o Source # | |
Defined in GI.Adw.Objects.HeaderBar |
toHeaderBar :: (MonadIO m, IsHeaderBar o) => o -> m HeaderBar Source #
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, 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 #
:: (HasCallStack, MonadIO m, IsHeaderBar a) | |
=> a |
|
-> m CenteringPolicy | Returns: the centering policy |
Gets the policy for aligning the center widget.
Since: 1.0
getDecorationLayout
headerBarGetDecorationLayout Source #
:: (HasCallStack, MonadIO m, IsHeaderBar a) | |
=> a |
|
-> m (Maybe Text) | Returns: the decoration layout |
Gets the decoration layout for self
.
Since: 1.0
getShowEndTitleButtons
headerBarGetShowEndTitleButtons Source #
:: (HasCallStack, MonadIO m, IsHeaderBar a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether to show title buttons at the end of self
.
Since: 1.0
getShowStartTitleButtons
headerBarGetShowStartTitleButtons Source #
:: (HasCallStack, MonadIO m, IsHeaderBar a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether to show title buttons at the start of self
.
Since: 1.0
getTitleWidget
headerBarGetTitleWidget Source #
:: (HasCallStack, MonadIO m, IsHeaderBar a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the title widget |
Gets the title widget widget of self
.
Since: 1.0
new
:: (HasCallStack, MonadIO m) | |
=> m HeaderBar | Returns: the newly created |
Creates a new AdwHeaderBar
.
Since: 1.0
packEnd
:: (HasCallStack, MonadIO m, IsHeaderBar a, IsWidget b) | |
=> a |
|
-> b |
|
-> m () |
Adds child
to self
, packed with reference to the end of self
.
Since: 1.0
packStart
:: (HasCallStack, MonadIO m, IsHeaderBar a, IsWidget b) | |
=> a |
|
-> b |
|
-> m () |
Adds child
to self
, packed with reference to the start of the self
.
Since: 1.0
remove
:: (HasCallStack, MonadIO m, IsHeaderBar a, IsWidget b) | |
=> a |
|
-> b |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsHeaderBar a) | |
=> a |
|
-> CenteringPolicy |
|
-> m () |
Sets the policy for aligning the center widget.
Since: 1.0
setDecorationLayout
headerBarSetDecorationLayout Source #
:: (HasCallStack, MonadIO m, IsHeaderBar a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Sets the decoration layout for self
.
Since: 1.0
setShowEndTitleButtons
headerBarSetShowEndTitleButtons Source #
:: (HasCallStack, MonadIO m, IsHeaderBar a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether to show title buttons at the end of self
.
Since: 1.0
setShowStartTitleButtons
headerBarSetShowStartTitleButtons Source #
:: (HasCallStack, MonadIO m, IsHeaderBar a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether to show title buttons at the start of self
.
Since: 1.0
setTitleWidget
headerBarSetTitleWidget Source #
:: (HasCallStack, MonadIO m, IsHeaderBar a, IsWidget b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the title widget for self
.
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 ]