gi-adwaita-1.0.1: 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.ButtonContent

Description

A helper widget for creating buttons.

AdwButtonContent is a box-like widget with an icon and a label.

It's intended to be used as a direct child of Button, MenuButton or SplitButton, when they need to habe both an icon and a label, as follows:

xml code

<object class="GtkButton">
  <property name="child">
    <object class="AdwButtonContent">
      <property name="icon-name">document-open-symbolic</property>
      <property name="label" translatable="yes">_Open</property>
      <property name="use-underline">True</property>
    </object>
  </property>
</object>

AdwButtonContent handles style classes and connecting the mnemonic to the button automatically.

CSS nodes

buttoncontent
├── image
╰── label

AdwSplitButton's CSS node is called buttoncontent. It contains the subnodes image and label.

When inside a GtkButton or AdwSplitButton, the button will receive the .image-text-button style class. When inside a GtkMenuButton, the internal GtkButton will receive it instead.

Accessibility

AdwSplitButton uses the GTK_ACCESSIBLE_ROLE_GROUP role.

Since: 1.0

Synopsis

Exported types

class (GObject o, IsDescendantOf ButtonContent o) => IsButtonContent o Source #

Type class for types which can be safely cast to ButtonContent, for instance with toButtonContent.

Instances

Instances details
(GObject o, IsDescendantOf ButtonContent o) => IsButtonContent o Source # 
Instance details

Defined in GI.Adw.Objects.ButtonContent

toButtonContent :: (MonadIO m, IsButtonContent o) => o -> m ButtonContent Source #

Cast to ButtonContent, 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, 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, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getIconName, getLabel, 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, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getUseUnderline, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

Setters

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

getIconName

buttonContentGetIconName Source #

Arguments

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

self: a AdwButtonContent

-> m Text

Returns: the icon name

Gets the name of the displayed icon.

Since: 1.0

getLabel

buttonContentGetLabel Source #

Arguments

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

self: a AdwButtonContent

-> m Text

Returns: the label

Gets the displayed label.

Since: 1.0

getUseUnderline

buttonContentGetUseUnderline Source #

Arguments

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

self: a AdwButtonContent

-> m Bool

Returns: whether an underline in the text indicates a mnemonic

Gets whether an underline in the text indicates a mnemonic.

Since: 1.0

new

buttonContentNew Source #

Arguments

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

Returns: the new created AdwButtonContent

Creates a new AdwButtonContent.

Since: 1.0

setIconName

buttonContentSetIconName Source #

Arguments

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

self: a AdwButtonContent

-> Text

iconName: the new icon name

-> m () 

Sets the name of the displayed icon.

Since: 1.0

setLabel

buttonContentSetLabel Source #

Arguments

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

self: a AdwButtonContent

-> Text

label: the new label

-> m () 

Sets the displayed label.

Since: 1.0

setUseUnderline

buttonContentSetUseUnderline Source #

Arguments

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

self: a AdwButtonContent

-> Bool

useUnderline: whether an underline in the text indicates a mnemonic

-> m () 

Sets whether an underline in the text indicates a mnemonic.

Since: 1.0

Properties

iconName

The name of the displayed icon.

If empty, the icon is not shown.

Since: 1.0

constructButtonContentIconName :: (IsButtonContent o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getButtonContentIconName :: (MonadIO m, IsButtonContent o) => o -> m Text Source #

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

get buttonContent #iconName

setButtonContentIconName :: (MonadIO m, IsButtonContent o) => o -> Text -> m () Source #

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

set buttonContent [ #iconName := value ]

label

The displayed label.

Since: 1.0

constructButtonContentLabel :: (IsButtonContent o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getButtonContentLabel :: (MonadIO m, IsButtonContent o) => o -> m Text Source #

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

get buttonContent #label

setButtonContentLabel :: (MonadIO m, IsButtonContent o) => o -> Text -> m () Source #

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

set buttonContent [ #label := value ]

useUnderline

Whether an underline in the text indicates a mnemonic.

The mnemonic can be used to activate the parent button.

See ButtonContent:label.

Since: 1.0

constructButtonContentUseUnderline :: (IsButtonContent o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getButtonContentUseUnderline :: (MonadIO m, IsButtonContent o) => o -> m Bool Source #

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

get buttonContent #useUnderline

setButtonContentUseUnderline :: (MonadIO m, IsButtonContent o) => o -> Bool -> m () Source #

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

set buttonContent [ #useUnderline := value ]