HdyActionRow

HdyActionRow — A GtkListBox row used to present actions.

Functions

Properties

GtkWidget * activatable-widget Read / Write
gchar * icon-name Read / Write
gchar * subtitle Read / Write
gboolean use-underline Read / Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkBin
                    ╰── GtkListBoxRow
                        ╰── HdyPreferencesRow
                            ╰── HdyActionRow
                                ╰── HdyComboRow

Implemented Interfaces

HdyActionRow implements AtkImplementorIface, GtkBuildable and GtkActionable.

Description

The HdyActionRow widget can have a title, a subtitle and an icon. The row can receive additional widgets at its end, or prefix widgets at its start.

It is convenient to present a preference and its related actions.

HdyActionRow is unactivatable by default, giving it an activatable widget will automatically make it activatable, but unsetting it won't change the row's activatability.

HdyActionRow as GtkBuildable

The GtkWindow implementation of the GtkBuildable interface supports setting a child at its end by omitting the “type” attribute of a <child> element.

It also supports setting a child as a prefix widget by specifying “prefix” as the “type” attribute of a <child> element.


CSS nodes

HdyActionRow has a main CSS node with name row.

It contains the subnode box.header for its main horizontal box, and box.title for the vertical box containing the title and subtitle labels.

It contains subnodes label.title and label.subtitle representing respectively the title label and subtitle label.

Functions

hdy_action_row_new ()

GtkWidget *
hdy_action_row_new (void);

Creates a new HdyActionRow.

Returns

a new HdyActionRow

Since: 0.0.6


hdy_action_row_get_subtitle ()

const gchar *
hdy_action_row_get_subtitle (HdyActionRow *self);

Gets the subtitle for self .

Parameters

self

a HdyActionRow

 

Returns

the subtitle for self , or NULL.

[transfer none][nullable]

Since: 0.0.6


hdy_action_row_set_subtitle ()

void
hdy_action_row_set_subtitle (HdyActionRow *self,
                             const gchar *subtitle);

Sets the subtitle for self .

Parameters

self

a HdyActionRow

 

subtitle

the subtitle.

[nullable]

Since: 0.0.6


hdy_action_row_get_icon_name ()

const gchar *
hdy_action_row_get_icon_name (HdyActionRow *self);

Gets the icon name for self .

Parameters

self

a HdyActionRow

 

Returns

the icon name for self .

Since: 0.0.6


hdy_action_row_set_icon_name ()

void
hdy_action_row_set_icon_name (HdyActionRow *self,
                              const gchar *icon_name);

Sets the icon name for self .

Parameters

self

a HdyActionRow

 

icon_name

the icon name

 

Since: 0.0.6


hdy_action_row_get_activatable_widget ()

GtkWidget *
hdy_action_row_get_activatable_widget (HdyActionRow *self);

Gets the widget activated when self is activated.

Parameters

self

a HdyActionRow

 

Returns

the widget activated when self is activated, or NULL if none has been set.

[nullable][transfer none]

Since: 0.0.7


hdy_action_row_set_activatable_widget ()

void
hdy_action_row_set_activatable_widget (HdyActionRow *self,
                                       GtkWidget *widget);

Sets the widget to activate when self is activated, either by clicking on it, by calling hdy_action_row_activate(), or via mnemonics in the title or the subtitle. See the “use_underline” property to enable mnemonics.

The target widget will be activated by emitting the GtkWidget::mnemonic-activate signal on it.

Parameters

self

a HdyActionRow

 

widget

the target GtkWidget, or NULL to unset.

[nullable]

Since: 0.0.7


hdy_action_row_get_use_underline ()

gboolean
hdy_action_row_get_use_underline (HdyActionRow *self);

Gets whether an embedded underline in the text of the title and subtitle labels indicates a mnemonic. See hdy_action_row_set_use_underline().

Parameters

self

a HdyActionRow

 

Returns

TRUE if an embedded underline in the title and subtitle labels indicates the mnemonic accelerator keys.

Since: 0.0.6


hdy_action_row_set_use_underline ()

void
hdy_action_row_set_use_underline (HdyActionRow *self,
                                  gboolean use_underline);

If true, an underline in the text of the title and subtitle labels indicates the next character should be used for the mnemonic accelerator key.

Parameters

self

a HdyActionRow

 

use_underline

TRUE if underlines in the text indicate mnemonics

 

Since: 0.0.6


hdy_action_row_add_prefix ()

void
hdy_action_row_add_prefix (HdyActionRow *self,
                           GtkWidget *widget);

Adds a prefix widget to self .

Parameters

self

a HdyActionRow

 

widget

the prefix widget

 

Since: 0.0.6


hdy_action_row_activate ()

void
hdy_action_row_activate (HdyActionRow *self);

Types and Values

HDY_TYPE_ACTION_ROW

#define HDY_TYPE_ACTION_ROW (hdy_action_row_get_type())

struct HdyActionRowClass

struct HdyActionRowClass {
  GtkListBoxRowClass parent_class;

  void (*activate) (HdyActionRow *self);
};

Members

activate ()

Activates the row to trigger its main action.

 

HdyActionRow

typedef struct _HdyActionRow HdyActionRow;

Property Details

The “activatable-widget” property

  “activatable-widget”       GtkWidget *

The activatable widget for this row.

Flags: Read / Write

Since: 0.0.7


The “icon-name” property

  “icon-name”                gchar *

The icon name for this row.

Flags: Read / Write

Default value: ""

Since: 0.0.6


The “subtitle” property

  “subtitle”                 gchar *

The subtitle for this row.

Flags: Read / Write

Default value: ""

Since: 0.0.6


The “use-underline” property

  “use-underline”            gboolean

Whether an embedded underline in the text of the title and subtitle labels indicates a mnemonic.

Flags: Read / Write

Default value: FALSE

Since: 0.0.6

Signal Details

The “activated” signal

void
user_function (HdyActionRow *self,
               gpointer      user_data)

This signal is emitted after the row has been activated.

Parameters

self

The HdyActionRow instance

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 1.0