1.50 <AdwSidebarItem>

Class: <AdwSidebarItem>

It derives from <GObject>.

An item within SidebarSection.

Sidebar items must have a title, set via SidebarItem:title.

Sidebar items should, but are not required to, have an icon. Icons can be set from an icon name, via SidebarItem:icon-name, or a <GdkPaintable>, via SidebarItem:icon-paintable.

Items can also have subtitles, set with the SidebarItem:subtitle property. Subtitles should be used sparingly.

To add a tooltip, use SidebarItem:tooltip. Tooltips always use Pango markup.

Items can have an arbitrary suffix widget, set with the SidebarItem:suffix properties. It will be displayed at the end of its row, or before the arrow in the Adw.SidebarMode.page mode.

To hide or disable the item, use the SidebarItem:visible and SidebarItem:enabled properties respectively.

To access the items’s section, use SidebarItem:section.

It’s also possible to access the index of the item in both the section and the sidebar, using SidebarItem.get_section_index and SidebarItem.get_index respectively.

Dragging content over sidebar items activates them by default. To disable this behavior, set SidebarItem:drag-motion-activate to FALSE.

<AdwSidebarItem> is derivable, and applications that need to associate each page with data can store it in the items themselves this way.

Fields

parent-instance

Properties

Property: sidebar-item:drag-motion-activate self

Whether to activate the item on pointer motion during Drag-and-Drop.

This is needed to be able to drag content into the page the item represents, when the sidebar is used as a page switcher. However, it may be unwanted when dropping content onto the item itself, so it can be disabled.

Its value is a boolean.

Set it with (set! (sidebar-item:drag-motion-activate self) value).

Property: sidebar-item:enabled self

Whether the item is enabled.

See widget:sensitive.

Its value is a boolean.

Set it with (set! (sidebar-item:enabled self) value).

Property: sidebar-item:icon-name self

The icon name for this item.

Mutually exclusive with SidebarItem:icon-paintable.

Its value is a string, or #f.

Set it with (set! (sidebar-item:icon-name self) value).

Property: sidebar-item:icon-paintable self

The paintable to use as the icon for this item.

Mutually exclusive with SidebarItem:icon-name.

Its value is a <GdkPaintable>, or #f.

Set it with (set! (sidebar-item:icon-paintable self) value).

Property: sidebar-item:section self

The section the item is in.

Its value is a <AdwSidebarSection>, or #f.

It is read only.

Property: sidebar-item:subtitle self

Subtitle of the item.

Its value is a string, or #f.

Set it with (set! (sidebar-item:subtitle self) value).

Property: sidebar-item:suffix self

The suffix widget for this item.

Suffix will be shown at the end of the item’s row, or before the arrow in the Adw.SidebarMode.page mode.

Its value is a <GtkWidget>, or #f.

Set it with (set! (sidebar-item:suffix self) value).

Property: sidebar-item:title self

Title of the item.

Its value is a string, or #f.

Set it with (set! (sidebar-item:title self) value).

Property: sidebar-item:tooltip self

The tooltip of the item.

The tooltip can be marked up with the Pango text markup language.

Its value is a string, or #f.

Set it with (set! (sidebar-item:tooltip self) value).

Property: sidebar-item:use-underline self

Whether an underline in the title indicates a mnemonic.

The mnemonic can be used to activate the item.

Its value is a boolean.

Set it with (set! (sidebar-item:use-underline self) value).

Property: sidebar-item:visible self

Whether the item is visible.

Its value is a boolean.

Set it with (set! (sidebar-item:visible self) value).

Procedures

Method: sidebar-item:get-drag-motion-activate? self ⇒ %return
Method: get-drag-motion-activate? self ⇒ %return

Gets whether self will be activated on pointer motion during Drag-and-Drop.

self

Passed: a <AdwSidebarItem>.

a sidebar item

%return

Returned: a boolean.

whether to enable the item on drag motion

Method: sidebar-item:get-enabled? self ⇒ %return
Method: get-enabled? self ⇒ %return

Gets whether self is enabled.

self

Passed: a <AdwSidebarItem>.

a sidebar item

%return

Returned: a boolean.

whether the item is enabled

Method: sidebar-item:get-icon-name self ⇒ %return
Method: get-icon-name self ⇒ %return

Gets the icon name for item.

self

Passed: a <AdwSidebarItem>.

a sidebar item

%return

Returned: a string, or #f.

the icon name

Method: sidebar-item:get-icon-paintable self ⇒ %return
Method: get-icon-paintable self ⇒ %return

Gets the paintable used as the icon for item.

self

Passed: a <AdwSidebarItem>.

a sidebar item

%return

Returned: a <GdkPaintable>, or #f.

the icon paintable

Method: sidebar-item:get-index self ⇒ %return
Method: get-index self ⇒ %return

Gets index of self within its Sidebar.

If self is within a section, but that section is not in a sidebar, index will be within the section only.

If self is not within a section, the index will be 0.

The item can later be retrieved by passing this index into Sidebar.get_item.

self

Passed: a <AdwSidebarItem>.

a sidebar item

%return

Returned: an unsigned 32-bit integer.

the index of self

Method: sidebar-item:get-section self ⇒ %return
Method: get-section self ⇒ %return

Gets the section self is in.

self

Passed: a <AdwSidebarItem>.

a sidebar item

%return

Returned: a <AdwSidebarSection>, or #f.

the section of self

Method: sidebar-item:get-section-index self ⇒ %return
Method: get-section-index self ⇒ %return

Gets index of self within its SidebarSection.

If self is not within a section, the index will be 0.

The item can later be retrieved by passing this index into SidebarSection.get_item.

self

Passed: a <AdwSidebarItem>.

a sidebar item

%return

Returned: an unsigned 32-bit integer.

the index of self

Method: sidebar-item:get-subtitle self ⇒ %return
Method: get-subtitle self ⇒ %return

Gets the subtitle of self.

self

Passed: a <AdwSidebarItem>.

a sidebar item

%return

Returned: a string, or #f.

the subtitle

Method: sidebar-item:get-suffix self ⇒ %return
Method: get-suffix self ⇒ %return

Gets the suffix widget for self.

self

Passed: a <AdwSidebarItem>.

a sidebar item

%return

Returned: a <GtkWidget>, or #f.

the suffix widget

Method: sidebar-item:get-title self ⇒ %return
Method: get-title self ⇒ %return

Gets the title of self.

self

Passed: a <AdwSidebarItem>.

a sidebar item

%return

Returned: a string, or #f.

the title

Method: sidebar-item:get-tooltip self ⇒ %return
Method: get-tooltip self ⇒ %return

Gets the tooltip of self.

self

Passed: a <AdwSidebarItem>.

a sidebar item

%return

Returned: a string, or #f.

the tooltip

Method: sidebar-item:get-use-underline? self ⇒ %return
Method: get-use-underline? self ⇒ %return

Gets whether an underline in the title indicates a mnemonic.

self

Passed: a <AdwSidebarItem>.

a sidebar item

%return

Returned: a boolean.

whether an underline in the text indicates a mnemonic

Method: sidebar-item:get-visible? self ⇒ %return
Method: get-visible? self ⇒ %return

Gets whether self is visible.

self

Passed: a <AdwSidebarItem>.

a sidebar item

%return

Returned: a boolean.

whether the item is visible

Procedure: sidebar-item:new title ⇒ %return

Creates a new <AdwSidebarItem> with title as its title.

title

Passed: a string.

the item title

%return

Returned: a <AdwSidebarItem>.

the newly created <AdwSidebarItem>

Method: sidebar-item:set-drag-motion-activate self drag-motion-activate
Method: set-drag-motion-activate self drag-motion-activate

Sets whether to activate self on pointer motion during Drag-and-Drop.

This is needed to be able to drag content into the page the item represents, when the sidebar is used as a page switcher. However, it may be unwanted when dropping content onto the item itself, so it can be disabled.

self

Passed: a <AdwSidebarItem>.

a sidebar item

drag-motion-activate

Passed: a boolean.

whether to enable the item on drag motion

Method: sidebar-item:set-enabled self enabled
Method: set-enabled self enabled

Sets whether self is enabled.

See widget:sensitive.

self

Passed: a <AdwSidebarItem>.

a sidebar item

enabled

Passed: a boolean.

whether to enable the item

Method: sidebar-item:set-icon-name self [icon-name]
Method: set-icon-name self [icon-name]

Sets the icon name for item.

Mutually exclusive with SidebarItem:icon-paintable.

self

Passed: a <AdwSidebarItem>.

a sidebar item

icon-name

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

the icon name

Method: sidebar-item:set-icon-paintable self [paintable]
Method: set-icon-paintable self [paintable]

Sets the paintable to use as the icon for item.

Mutually exclusive with SidebarItem:icon-name.

self

Passed: a <AdwSidebarItem>.

a sidebar item

paintable

Passed, or left out: a <GdkPaintable>, or #f.

the icon paintable

Method: sidebar-item:set-subtitle self [subtitle]
Method: set-subtitle self [subtitle]

Sets the subtitle of self.

self

Passed: a <AdwSidebarItem>.

a sidebar item

subtitle

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

the subtitle

Method: sidebar-item:set-suffix self [suffix]
Method: set-suffix self [suffix]

Sets the suffix widget for self.

Suffix will be shown at the end of the item’s row, or before the arrow in the Adw.SidebarMode.page mode.

self

Passed: a <AdwSidebarItem>.

a sidebar item

suffix

Passed, or left out: a <GtkWidget>, or #f.

the suffix widget

Method: sidebar-item:set-title self [title]
Method: set-title self [title]

Sets the title of self.

self

Passed: a <AdwSidebarItem>.

a sidebar item

title

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

the title

Method: sidebar-item:set-tooltip self [tooltip]
Method: set-tooltip self [tooltip]

Sets the tooltip of self.

The tooltip can be marked up with the Pango text markup language.

self

Passed: a <AdwSidebarItem>.

a sidebar item

tooltip

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

the tooltip

Method: sidebar-item:set-use-underline self use-underline
Method: set-use-underline self use-underline

Sets whether an underline in the title indicates a mnemonic.

The mnemonic can be used to activate the item.

self

Passed: a <AdwSidebarItem>.

a sidebar item

use-underline

Passed: a boolean.

whether an underline in the text indicates a mnemonic

Method: sidebar-item:set-visible self visible
Method: set-visible self visible

Sets whether self is visible.

self

Passed: a <AdwSidebarItem>.

a sidebar item

visible

Passed: a boolean.

whether the item is visible