Adw.SidebarItem¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Adw.SidebarItem(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
An item within [class`SidebarSection`].
Sidebar items must have a title, set via [property`SidebarItem`:py:data::title<Adw.SidebarItem.props.title>].
Sidebar items should, but are not required to, have an icon. Icons can be set from an icon name, via [property`SidebarItem`:py:data::icon-name<Adw.SidebarItem.props.icon_name>], or a [iface`Gdk`.Paintable], via [property`SidebarItem`:py:data::icon-paintable<Adw.SidebarItem.props.icon_paintable>].
Items can also have subtitles, set with the [property`SidebarItem`:py:data::subtitle<Adw.SidebarItem.props.subtitle>] property. Subtitles should be used sparingly.
To add a tooltip, use [property`SidebarItem`:py:data::tooltip<Adw.SidebarItem.props.tooltip>]. Tooltips always use Pango markup.
Items can have an arbitrary suffix widget, set with the [property`SidebarItem`:py:data::suffix<Adw.SidebarItem.props.suffix>] properties. It will be displayed at the end of its row, or before the arrow in the [enum`Adw`.SidebarMode.page] mode.
To hide or disable the item, use the [property`SidebarItem`:py:data::visible<Adw.SidebarItem.props.visible>] and [property`SidebarItem`:py:data::enabled<Adw.SidebarItem.props.enabled>] properties respectively.
To access the items’s section, use [property`SidebarItem`:py:data::section<Adw.SidebarItem.props.section>].
It’s also possible to access the index of the item in both the section and the sidebar, using [method`SidebarItem`.get_section_index] and [method`SidebarItem`.get_index] respectively.
Dragging content over sidebar items activates them by default. To disable this behavior, set [property`SidebarItem`:py:data::drag-motion-activate<Adw.SidebarItem.props.drag_motion_activate>] to
FALSE.AdwSidebarItemis derivable, and applications that need to associate each page with data can store it in the items themselves this way.New in version 1.9.
- classmethod new(title)¶
- Parameters:
title (
str) – the item title- Returns:
the newly created
AdwSidebarItem- Return type:
Creates a new
AdwSidebarItemwith title as its title.New in version 1.9.
- get_drag_motion_activate()¶
- Returns:
whether to enable the item on drag motion
- Return type:
Gets whether self will be activated on pointer motion during Drag-and-Drop.
New in version 1.9.
- get_enabled()¶
- Returns:
whether the item is enabled
- Return type:
Gets whether self is enabled.
New in version 1.9.
- get_icon_name()¶
-
Gets the icon name for item.
New in version 1.9.
- get_icon_paintable()¶
- Returns:
the icon paintable
- Return type:
Gets the paintable used as the icon for item.
New in version 1.9.
- get_index()¶
- Returns:
the index of self
- Return type:
Gets index of self within its [class`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 [method`Sidebar`.get_item].
New in version 1.9.
- get_section()¶
- Returns:
the section of self
- Return type:
Gets the section self is in.
New in version 1.9.
- get_section_index()¶
- Returns:
the index of self
- Return type:
Gets index of self within its [class`SidebarSection`].
If self is not within a section, the index will be 0.
The item can later be retrieved by passing this index into [method`SidebarSection`.get_item].
New in version 1.9.
- get_subtitle()¶
-
Gets the subtitle of self.
New in version 1.9.
- get_suffix()¶
- Returns:
the suffix widget
- Return type:
Gtk.WidgetorNone
Gets the suffix widget for self.
New in version 1.9.
- get_title()¶
-
Gets the title of self.
New in version 1.9.
- get_tooltip()¶
-
Gets the tooltip of self.
New in version 1.9.
- get_use_underline()¶
- Returns:
whether an underline in the text indicates a mnemonic
- Return type:
Gets whether an underline in the title indicates a mnemonic.
New in version 1.9.
- get_visible()¶
- Returns:
whether the item is visible
- Return type:
Gets whether self is visible.
New in version 1.9.
- set_drag_motion_activate(drag_motion_activate)¶
- Parameters:
drag_motion_activate (
bool) – whether to enable the item on drag motion
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.
New in version 1.9.
- set_enabled(enabled)¶
- Parameters:
enabled (
bool) – whether to enable the item
Sets whether self is enabled.
See [property`Gtk`.Widget:sensitive].
New in version 1.9.
- set_icon_name(icon_name)¶
-
Sets the icon name for item.
Mutually exclusive with [property`SidebarItem`:py:data::icon-paintable<Adw.SidebarItem.props.icon_paintable>].
New in version 1.9.
- set_icon_paintable(paintable)¶
- Parameters:
paintable (
Gdk.PaintableorNone) – the icon paintable
Sets the paintable to use as the icon for item.
Mutually exclusive with [property`SidebarItem`:py:data::icon-name<Adw.SidebarItem.props.icon_name>].
New in version 1.9.
- set_subtitle(subtitle)¶
-
Sets the subtitle of self.
New in version 1.9.
- set_suffix(suffix)¶
- Parameters:
suffix (
Gtk.WidgetorNone) – the suffix widget
Sets the suffix widget for self.
Suffix will be shown at the end of the item’s row, or before the arrow in the [enum`Adw`.SidebarMode.page] mode.
New in version 1.9.
- set_title(title)¶
-
Sets the title of self.
New in version 1.9.
- set_tooltip(tooltip)¶
-
Sets the tooltip of self.
The tooltip can be marked up with the Pango text markup language.
New in version 1.9.
Property Details¶
- Adw.SidebarItem.props.drag_motion_activate¶
- Name:
drag-motion-activate- Type:
- Default Value:
- Flags:
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.
New in version 1.9.
- Adw.SidebarItem.props.enabled¶
- Name:
enabled- Type:
- Default Value:
- Flags:
Whether the item is enabled.
See [property`Gtk`.Widget:sensitive].
New in version 1.9.
- Adw.SidebarItem.props.icon_name¶
- Name:
icon-name- Type:
- Default Value:
- Flags:
The icon name for this item.
Mutually exclusive with [property`SidebarItem`:py:data::icon-paintable<Adw.SidebarItem.props.icon_paintable>].
New in version 1.9.
- Adw.SidebarItem.props.icon_paintable¶
- Name:
icon-paintable- Type:
- Default Value:
- Flags:
The paintable to use as the icon for this item.
Mutually exclusive with [property`SidebarItem`:py:data::icon-name<Adw.SidebarItem.props.icon_name>].
New in version 1.9.
- Adw.SidebarItem.props.section¶
- Name:
section- Type:
- Default Value:
- Flags:
The section the item is in.
New in version 1.9.
- Adw.SidebarItem.props.subtitle¶
- Name:
subtitle- Type:
- Default Value:
''- Flags:
Subtitle of the item.
New in version 1.9.
- Adw.SidebarItem.props.suffix¶
- Name:
suffix- Type:
- Default Value:
- Flags:
The suffix widget for this item.
Suffix will be shown at the end of the item’s row, or before the arrow in the [enum`Adw`.SidebarMode.page] mode.
New in version 1.9.
- Adw.SidebarItem.props.title¶
- Name:
title- Type:
- Default Value:
''- Flags:
Title of the item.
New in version 1.9.
- Adw.SidebarItem.props.tooltip¶
- Name:
tooltip- Type:
- Default Value:
''- Flags:
The tooltip of the item.
The tooltip can be marked up with the Pango text markup language.
New in version 1.9.
- Adw.SidebarItem.props.use_underline¶
- Name:
use-underline- Type:
- Default Value:
- Flags:
Whether an underline in the title indicates a mnemonic.
The mnemonic can be used to activate the item.
New in version 1.9.