gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.ActionBar

Contents

- Exported types
- Methods
  - getCenterWidget
  - getRevealed
  - new
  - packEnd
  - packStart
  - remove
  - setCenterWidget
  - setRevealed
- Properties
  - revealed

Description

Presents contextual actions.

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

`GtkActionBar` is expected to be displayed below the content and expand horizontally to fill the area.

It allows placing children at the start or the end. In addition, it contains an internal centered box which is centered with respect to the full width of the box, even if the children at either side take up different amounts of space.

# GtkActionBar as GtkBuildable

The `GtkActionBar` implementation of the `GtkBuildable` interface supports adding children at the start or end sides by specifying “start” or “end” as the “type” attribute of a `<child>` element, or setting the center widget by specifying “center” value.

# CSS nodes

    actionbar
    ╰── revealer
        ╰── box
            ├── box.start
            │   ╰── [start children]
            ├── [center widget]
            ╰── box.end
                ╰── [end children]

A `GtkActionBar`'s CSS node is called `actionbar`. It contains a `revealer` subnode, which contains a `box` subnode, which contains two `box` subnodes at the start and end of the action bar, with `start` and `end` style classes respectively, as well as a center node that represents the center child.

Each of the boxes contains children packed for that side.

Synopsis

- newtype ActionBar = ActionBar (ManagedPtr ActionBar)
- class (GObject o, IsDescendantOf ActionBar o) => IsActionBar o
- toActionBar :: (MonadIO m, IsActionBar o) => o -> m ActionBar
- actionBarGetCenterWidget :: (HasCallStack, MonadIO m, IsActionBar a) => a -> m (Maybe Widget)
- actionBarGetRevealed :: (HasCallStack, MonadIO m, IsActionBar a) => a -> m Bool
- actionBarNew :: (HasCallStack, MonadIO m) => m ActionBar
- actionBarPackEnd :: (HasCallStack, MonadIO m, IsActionBar a, IsWidget b) => a -> b -> m ()
- actionBarPackStart :: (HasCallStack, MonadIO m, IsActionBar a, IsWidget b) => a -> b -> m ()
- actionBarRemove :: (HasCallStack, MonadIO m, IsActionBar a, IsWidget b) => a -> b -> m ()
- actionBarSetCenterWidget :: (HasCallStack, MonadIO m, IsActionBar a, IsWidget b) => a -> Maybe b -> m ()
- actionBarSetRevealed :: (HasCallStack, MonadIO m, IsActionBar a) => a -> Bool -> m ()
- constructActionBarRevealed :: (IsActionBar o, MonadIO m) => Bool -> m (GValueConstruct o)
- getActionBarRevealed :: (MonadIO m, IsActionBar o) => o -> m Bool
- setActionBarRevealed :: (MonadIO m, IsActionBar o) => o -> Bool -> m ()

# Exported types

newtype ActionBar Source #

Memory-managed wrapper type.

Constructors

ActionBar (ManagedPtr ActionBar) |

#### Instances

Instances details

Eq ActionBar Source # |
Instance details Defined in GI.Gtk.Objects.ActionBar Methods (==) :: ActionBar -> ActionBar -> Bool Source # (/=) :: ActionBar -> ActionBar -> Bool Source #
GObject ActionBar Source # |
Instance details Defined in GI.Gtk.Objects.ActionBar
ManagedPtrNewtype ActionBar Source # |
Instance details Defined in GI.Gtk.Objects.ActionBar Methods toManagedPtr :: ActionBar -> ManagedPtr ActionBar Source #
TypedObject ActionBar Source # |
Instance details Defined in GI.Gtk.Objects.ActionBar Methods glibType :: IO GType Source #
HasParentTypes ActionBar Source # |
Instance details Defined in GI.Gtk.Objects.ActionBar
IsGValue (Maybe ActionBar) Source # | Convert `ActionBar` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.ActionBar Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe ActionBar -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe ActionBar) Source #
type ParentTypes ActionBar Source # |
Instance details Defined in GI.Gtk.Objects.ActionBar type ParentTypes ActionBar = '[Widget, Object, Accessible, Buildable, ConstraintTarget]

class (GObject o, IsDescendantOf ActionBar o) => IsActionBar o Source #

Type class for types which can be safely cast to `ActionBar`, for instance with `toActionBar`.

#### Instances

Instances details

(GObject o, IsDescendantOf ActionBar o) => IsActionBar o Source # |
Instance details Defined in GI.Gtk.Objects.ActionBar

toActionBar :: (MonadIO m, IsActionBar o) => o -> m ActionBar Source #

Cast to `ActionBar`, 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, 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, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateState, watchClosure.

#### Getters

getAccessibleId, getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBaseline, getBounds, getBuildableId, getCanFocus, getCanTarget, getCenterWidget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRevealed, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

#### Setters

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

## getCenterWidget

actionBarGetCenterWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionBar a) |
=> a | `actionBar`: an action bsar
-> m (Maybe Widget) | Returns: the center widget

Retrieves the center bar widget of the bar.

## getRevealed

actionBarGetRevealed Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionBar a) |
=> a | `actionBar`: an action bar
-> m Bool | Returns: the current value of the ActionBar:revealed property

Gets whether the contents of the action bar are revealed.

## new

actionBarNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m ActionBar | Returns: a new `GtkActionBar`

Creates a new action bar widget.

## packEnd

actionBarPackEnd Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionBar a, IsWidget b) |
=> a | `actionBar`: an action bar
-> b | `child`: the widget to be added
-> m () |

Adds a child to the action bar, packed with reference to the end of the action bar.

## packStart

actionBarPackStart Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionBar a, IsWidget b) |
=> a | `actionBar`: an action bar
-> b | `child`: the widget to be added
-> m () |

Adds a child to the action, packed with reference to the start of the action bar.

## remove

actionBarRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionBar a, IsWidget b) |
=> a | `actionBar`: an action bar
-> b | `child`: the widget to be removed
-> m () |

Removes a child from the action bar.

## setCenterWidget

actionBarSetCenterWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionBar a, IsWidget b) |
=> a | `actionBar`: an action bar
-> Maybe b | `centerWidget`: a widget to use for the center
-> m () |

Sets the center widget for the action bar.

## setRevealed

actionBarSetRevealed Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionBar a) |
=> a | `actionBar`: an action bar
-> Bool | `revealed`: the new value for the property
-> m () |

Reveals or conceals the content of the action bar.

Note: this does not show or hide the action bar in the Widget:visible sense, so revealing has no effect if the action bar is hidden.

# Properties

## revealed

Controls whether the action bar shows its contents.

constructActionBarRevealed :: (IsActionBar o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getActionBarRevealed :: (MonadIO m, IsActionBar o) => o -> m Bool Source #

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

    get actionBar #revealed

setActionBarRevealed :: (MonadIO m, IsActionBar o) => o -> Bool -> m () Source #

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

    set actionBar [ #revealed := value ]