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 bar with contextual information.
<picture> <source srcset="banner-dark.png" media="(prefers-color-scheme: dark)"> <img src="banner.png" alt="banner"> </picture>
Banners are hidden by default, use [propertybanner
:revealed] to show them.
Banners have a title, set with [propertybanner
:title]. Titles can be marked
up with Pango markup, use [propertybanner
:use-markup] to enable it.
The title will be shown centered or left-aligned depending on available space.
Banners can optionally have a button with text on it, set through
[propertybanner
:button-label]. The button can be used with a GAction
,
or with the signalbanner
[buttonClicked] signal.
CSS nodes
AdwBanner
has a main CSS node with the name banner
.
Since: 1.3
Synopsis
- newtype Banner = Banner (ManagedPtr Banner)
- class (GObject o, IsDescendantOf Banner o) => IsBanner o
- toBanner :: (MonadIO m, IsBanner o) => o -> m Banner
- bannerGetButtonLabel :: (HasCallStack, MonadIO m, IsBanner a) => a -> m (Maybe Text)
- bannerGetRevealed :: (HasCallStack, MonadIO m, IsBanner a) => a -> m Bool
- bannerGetTitle :: (HasCallStack, MonadIO m, IsBanner a) => a -> m Text
- bannerGetUseMarkup :: (HasCallStack, MonadIO m, IsBanner a) => a -> m Bool
- bannerNew :: (HasCallStack, MonadIO m) => Text -> m Banner
- bannerSetButtonLabel :: (HasCallStack, MonadIO m, IsBanner a) => a -> Maybe Text -> m ()
- bannerSetRevealed :: (HasCallStack, MonadIO m, IsBanner a) => a -> Bool -> m ()
- bannerSetTitle :: (HasCallStack, MonadIO m, IsBanner a) => a -> Text -> m ()
- bannerSetUseMarkup :: (HasCallStack, MonadIO m, IsBanner a) => a -> Bool -> m ()
- clearBannerButtonLabel :: (MonadIO m, IsBanner o) => o -> m ()
- constructBannerButtonLabel :: (IsBanner o, MonadIO m) => Text -> m (GValueConstruct o)
- getBannerButtonLabel :: (MonadIO m, IsBanner o) => o -> m (Maybe Text)
- setBannerButtonLabel :: (MonadIO m, IsBanner o) => o -> Text -> m ()
- constructBannerRevealed :: (IsBanner o, MonadIO m) => Bool -> m (GValueConstruct o)
- getBannerRevealed :: (MonadIO m, IsBanner o) => o -> m Bool
- setBannerRevealed :: (MonadIO m, IsBanner o) => o -> Bool -> m ()
- constructBannerTitle :: (IsBanner o, MonadIO m) => Text -> m (GValueConstruct o)
- getBannerTitle :: (MonadIO m, IsBanner o) => o -> m Text
- setBannerTitle :: (MonadIO m, IsBanner o) => o -> Text -> m ()
- constructBannerUseMarkup :: (IsBanner o, MonadIO m) => Bool -> m (GValueConstruct o)
- getBannerUseMarkup :: (MonadIO m, IsBanner o) => o -> m Bool
- setBannerUseMarkup :: (MonadIO m, IsBanner o) => o -> Bool -> m ()
- type BannerButtonClickedCallback = IO ()
- afterBannerButtonClicked :: (IsBanner a, MonadIO m) => a -> ((?self :: a) => BannerButtonClickedCallback) -> m SignalHandlerId
- onBannerButtonClicked :: (IsBanner a, MonadIO m) => a -> ((?self :: a) => BannerButtonClickedCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq Banner Source # | |
GObject Banner Source # | |
Defined in GI.Adw.Objects.Banner | |
ManagedPtrNewtype Banner Source # | |
Defined in GI.Adw.Objects.Banner toManagedPtr :: Banner -> ManagedPtr Banner | |
TypedObject Banner Source # | |
Defined in GI.Adw.Objects.Banner | |
HasParentTypes Banner Source # | |
Defined in GI.Adw.Objects.Banner | |
IsGValue (Maybe Banner) Source # | Convert |
Defined in GI.Adw.Objects.Banner gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Banner -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Banner) | |
type ParentTypes Banner Source # | |
Defined in GI.Adw.Objects.Banner type ParentTypes Banner = '[Widget, Object, Accessible, Actionable, Buildable, ConstraintTarget] |
class (GObject o, IsDescendantOf Banner o) => IsBanner o Source #
Instances
(GObject o, IsDescendantOf Banner o) => IsBanner o Source # | |
Defined in GI.Adw.Objects.Banner |
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, getActionName, getActionTargetValue, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBounds, getBuildableId, getButtonLabel, 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, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRevealed, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTitle, getTooltipMarkup, getTooltipText, getUseMarkup, getValign, getVexpand, getVexpandSet, getVisible, getWidth.
Setters
setAccessibleParent, setActionName, setActionTargetValue, setButtonLabel, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDetailedActionName, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setRevealed, setSensitive, setSizeRequest, setStateFlags, setTitle, setTooltipMarkup, setTooltipText, setUseMarkup, setValign, setVexpand, setVexpandSet, setVisible.
getButtonLabel
:: (HasCallStack, MonadIO m, IsBanner a) | |
=> a |
|
-> m (Maybe Text) | Returns: the button label for |
Gets the button label for self
.
Since: 1.3
getRevealed
:: (HasCallStack, MonadIO m, IsBanner a) | |
=> a |
|
-> m Bool | Returns: Whether a banner is revealed |
Gets if a banner is revealed
Since: 1.3
getTitle
:: (HasCallStack, MonadIO m, IsBanner a) | |
=> a |
|
-> m Text | Returns: the title for |
Gets the title for self
.
Since: 1.3
getUseMarkup
:: (HasCallStack, MonadIO m, IsBanner a) | |
=> a |
|
-> m Bool | Returns: whether to use markup |
Gets whether to use Pango markup for the banner title.
Since: 1.3
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Banner | Returns: the newly created |
Creates a new AdwBanner
.
Since: 1.3
setButtonLabel
:: (HasCallStack, MonadIO m, IsBanner a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Sets the button label for self
.
If set to ""
or NULL
, the button won't be shown.
The button can be used with a GAction
, or with the
signalbanner
[buttonClicked] signal.
Since: 1.3
setRevealed
:: (HasCallStack, MonadIO m, IsBanner a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether a banner should be revealed
Since: 1.3
setTitle
:: (HasCallStack, MonadIO m, IsBanner a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the title for this banner.
See also: [propertybanner
:use-markup].
Since: 1.3
setUseMarkup
:: (HasCallStack, MonadIO m, IsBanner a) | |
=> a |
|
-> Bool |
|
-> m () |
Properties
buttonLabel
The label to show on the button.
If set to ""
or NULL
, the button won't be shown.
The button can be used with a GAction
, or with the
signalbanner
[buttonClicked] signal.
Since: 1.3
clearBannerButtonLabel :: (MonadIO m, IsBanner o) => o -> m () Source #
Set the value of the “button-label
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#buttonLabel
constructBannerButtonLabel :: (IsBanner o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “button-label
” property. This is rarely needed directly, but it is used by new
.
getBannerButtonLabel :: (MonadIO m, IsBanner o) => o -> m (Maybe Text) Source #
Get the value of the “button-label
” property.
When overloading is enabled, this is equivalent to
get
banner #buttonLabel
setBannerButtonLabel :: (MonadIO m, IsBanner o) => o -> Text -> m () Source #
Set the value of the “button-label
” property.
When overloading is enabled, this is equivalent to
set
banner [ #buttonLabel:=
value ]
revealed
Whether the banner is currently revealed.
Since: 1.3
constructBannerRevealed :: (IsBanner 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
.
getBannerRevealed :: (MonadIO m, IsBanner o) => o -> m Bool Source #
Get the value of the “revealed
” property.
When overloading is enabled, this is equivalent to
get
banner #revealed
setBannerRevealed :: (MonadIO m, IsBanner o) => o -> Bool -> m () Source #
Set the value of the “revealed
” property.
When overloading is enabled, this is equivalent to
set
banner [ #revealed:=
value ]
title
The title for this banner.
See also: [propertybanner
:use-markup].
Since: 1.3
constructBannerTitle :: (IsBanner o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “title
” property. This is rarely needed directly, but it is used by new
.
getBannerTitle :: (MonadIO m, IsBanner o) => o -> m Text Source #
Get the value of the “title
” property.
When overloading is enabled, this is equivalent to
get
banner #title
setBannerTitle :: (MonadIO m, IsBanner o) => o -> Text -> m () Source #
Set the value of the “title
” property.
When overloading is enabled, this is equivalent to
set
banner [ #title:=
value ]
useMarkup
constructBannerUseMarkup :: (IsBanner o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “use-markup
” property. This is rarely needed directly, but it is used by new
.
getBannerUseMarkup :: (MonadIO m, IsBanner o) => o -> m Bool Source #
Get the value of the “use-markup
” property.
When overloading is enabled, this is equivalent to
get
banner #useMarkup
setBannerUseMarkup :: (MonadIO m, IsBanner o) => o -> Bool -> m () Source #
Set the value of the “use-markup
” property.
When overloading is enabled, this is equivalent to
set
banner [ #useMarkup:=
value ]
Signals
buttonClicked
type BannerButtonClickedCallback = IO () Source #
This signal is emitted after the action button has been clicked.
It can be used as an alternative to setting an action.
Since: 1.3
afterBannerButtonClicked :: (IsBanner a, MonadIO m) => a -> ((?self :: a) => BannerButtonClickedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the buttonClicked signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
banner #buttonClicked callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onBannerButtonClicked :: (IsBanner a, MonadIO m) => a -> ((?self :: a) => BannerButtonClickedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the buttonClicked signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
banner #buttonClicked callback