Next: <AdwBin>, Previous: <AdwAvatar>, Up: Classes   [Index]


1.9 <AdwBanner> ¶

Class: <AdwBanner> ¶

It derives from <GtkWidget>.

A bar with contextual information.

Banners are hidden by default, use Banner:revealed to show them.

Banners have a title, set with Banner:title. Titles can be marked up with Pango markup, use Banner: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 Banner:button-label. The button can be used with a <GAction>, or with the "button-clicked" signal. The button can have different styles, a gray style and a suggested style.

CSS nodes ¶

<AdwBanner> has a main CSS node with the name banner.

Properties ¶

Property: banner:button-label self ¶

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 "button-clicked" signal.

Its value is a string, or #f.

Set it with (set! (banner:button-label self) value).

Property: banner:button-style self ¶

The style class to use for the banner button.

When set to Adw.BannerButtonStyle.default, the button is grey. When set to Adw.BannerButtonStyle.suggested, the button uses the ‘.suggested-action‘ appearance.

Its value is a <AdwBannerButtonStyle> (or, to set it, one of its symbols).

Set it with (set! (banner:button-style self) value).

Property: banner:revealed self ¶

Whether the banner is currently revealed.

Its value is a boolean.

Set it with (set! (banner:revealed self) value).

Property: banner:title self ¶

The title for this banner.

See also: Banner:use-markup.

Its value is a string, or #f.

Set it with (set! (banner:title self) value).

Property: banner:use-markup self ¶

Whether to use Pango markup for the banner title.

See also parse-markup.

Its value is a boolean.

Set it with (set! (banner:use-markup self) value).

Procedures ¶

Method: banner:get-button-label self ⇒ %return ¶
Method: get-button-label self ⇒ %return ¶

Gets the button label for self.

self

Passed: a <AdwBanner>.

a banner

%return

Returned: a string, or #f.

the button label for self

Method: banner:get-button-style self ⇒ %return ¶
Method: get-button-style self ⇒ %return ¶

Gets the style class in use for the banner button.

self

Passed: a <AdwBanner>.

a banner

%return

Returned: a <AdwBannerButtonStyle>.

the current button style

Method: banner:get-revealed? self ⇒ %return ¶
Method: get-revealed? self ⇒ %return ¶

Gets if a banner is revealed

self

Passed: a <AdwBanner>.

a banner

%return

Returned: a boolean.

Whether a banner is revealed

Method: banner:get-title self ⇒ %return ¶
Method: get-title self ⇒ %return ¶

Gets the title for self.

self

Passed: a <AdwBanner>.

a banner

%return

Returned: a string.

the title for self

Method: banner:get-use-markup? self ⇒ %return ¶
Method: get-use-markup? self ⇒ %return ¶

Gets whether to use Pango markup for the banner title.

self

Passed: a <AdwBanner>.

a banner

%return

Returned: a boolean.

whether to use markup

Procedure: banner:new title ⇒ %return ¶

Creates a new <AdwBanner>.

title

Passed: a string.

the banner title

%return

Returned: a <GtkWidget>.

the newly created <AdwBanner>

Method: banner:set-button-label self [label] ¶
Method: set-button-label self [label] ¶

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 "button-clicked" signal.

self

Passed: a <AdwBanner>.

a banner

label

Passed, or left out: a string, or #f.

the label

Method: banner:set-button-style self style ¶
Method: set-button-style self style ¶

Sets the style class to use for the banner button.

When set to Adw.BannerButtonStyle.default, the button is grey. When set to Adw.BannerButtonStyle.suggested, the button uses the ‘.suggested-action‘ appearance.

self

Passed: a <AdwBanner>.

a banner

style

Passed: a <AdwBannerButtonStyle>, or one of its symbols.

a button style

Method: banner:set-revealed self revealed ¶
Method: set-revealed self revealed ¶

Sets whether a banner should be revealed

self

Passed: a <AdwBanner>.

a banner

revealed

Passed: a boolean.

whether a banner should be revealed

Method: banner:set-title self title ¶
Method: set-title self title ¶

Sets the title for this banner.

See also: Banner:use-markup.

self

Passed: a <AdwBanner>.

a banner

title

Passed: a string.

the title

Method: banner:set-use-markup self use-markup ¶
Method: set-use-markup self use-markup ¶

Sets whether to use Pango markup for the banner title.

See also parse-markup.

self

Passed: a <AdwBanner>.

a banner

use-markup

Passed: a boolean.

whether to use markup

Signals ¶

Signal: banner:button-clicked ¶

Connect a handler with (connect object banner:button-clicked handler). It is called as (handler self).

This signal is emitted after the action button has been clicked.

It can be used as an alternative to setting an action.

self

Passed: a <AdwBanner>.


Next: <AdwBin>, Previous: <AdwAvatar>, Up: Classes   [Index]