TabPage
Superclasses: Object
Implemented Interfaces: Accessible
An auxiliary class used by TabView
.
Methods
- class TabPage
-
- get_thumbnail_xalign() float
Gets the horizontal alignment of the thumbnail for
self
.Added in version 1.3.
- get_thumbnail_yalign() float
Gets the vertical alignment of the thumbnail for
self
.Added in version 1.3.
- invalidate_thumbnail() None
Invalidates thumbnail for
self
.If an
TabOverview
is open, the thumbnail representingself
will be immediately updated. Otherwise it will be update when opening the overview.Does nothing if
live_thumbnail
is set toTRUE
.See also
invalidate_thumbnails
.Added in version 1.3.
- set_icon(icon: Icon | None = None) None
Sets the icon of
self
.TabBar
andTabOverview
display the icon next to the title, unlessloading
is set toTRUE
.AdwTabBar
also won’t show the icon if the page is pinned and [propertyTabPage:indicator-icon] is set.- Parameters:
icon – the icon of
self
- set_indicator_activatable(activatable: bool) None
Sets whether the indicator of
self
is activatable.If set to
TRUE
,indicator_activated
will be emitted when the indicator icon is clicked.If
indicator_icon
is not set, does nothing.- Parameters:
activatable – whether the indicator is activatable
- set_indicator_icon(indicator_icon: Icon | None = None) None
Sets the indicator icon of
self
.A common use case is an audio or camera indicator in a web browser.
TabBar
will show it at the beginning of the tab, alongside icon representingicon
or loading spinner.If the page is pinned, the indicator will be shown instead of icon or spinner.
TabOverview
will show it at the at the top part of the thumbnail.indicator_tooltip
can be used to set the tooltip on the indicator icon.If
indicator_activatable
is set toTRUE
, the indicator icon can act as a button.- Parameters:
indicator_icon – the indicator icon of
self
- set_indicator_tooltip(tooltip: str) None
Sets the tooltip of the indicator icon of
self
.The tooltip can be marked up with the Pango text markup language.
See
indicator_icon
.Added in version 1.2.
- Parameters:
tooltip – the indicator tooltip of
self
- set_keyword(keyword: str) None
Sets the search keyword for
self
.TabOverview
can search pages by their keywords in addition to their titles and tooltips.Keywords allow to include e.g. page URLs into tab search in a web browser.
Added in version 1.3.
- Parameters:
keyword – the search keyword
- set_live_thumbnail(live_thumbnail: bool) None
Sets whether to enable live thumbnail for
self
.When set to
TRUE
,self
’s thumbnail inTabOverview
will update immediately whenself
is redrawn or resized.If it’s set to
FALSE
, the thumbnail will only be live when theself
is selected, and otherwise it will be static and will only update wheninvalidate_thumbnail
orinvalidate_thumbnails
is called.Added in version 1.3.
- Parameters:
live_thumbnail – whether to enable live thumbnail
- set_loading(loading: bool) None
Sets whether
self
is loading.If set to
TRUE
,TabBar
andTabOverview
will display a spinner in place of icon.If the page is pinned and
indicator_icon
is set, loading status will not be visible withAdwTabBar
.- Parameters:
loading – whether
self
is loading
- set_needs_attention(needs_attention: bool) None
Sets whether
self
needs attention.TabBar
will display a line under the tab representing the page if set toTRUE
. If the tab is not visible, the corresponding edge of the tab bar will be highlighted.TabOverview
will display a dot in the corner of the thumbnail if set toTRUE
.TabButton
will display a dot if any of the pages that aren’t selected haveneeds_attention
set toTRUE
.- Parameters:
needs_attention – whether
self
needs attention
- set_thumbnail_xalign(xalign: float) None
Sets the horizontal alignment of the thumbnail for
self
.If the page is so wide that
TabOverview
can’t display it completely and has to crop it, horizontal alignment will determine which part of the page will be visible.For example, 0.5 means the center of the page will be visible, 0 means the start edge will be visible and 1 means the end edge will be visible.
The default horizontal alignment is 0.
Added in version 1.3.
- Parameters:
xalign – the new value
- set_thumbnail_yalign(yalign: float) None
Sets the vertical alignment of the thumbnail for
self
.If the page is so tall that
TabOverview
can’t display it completely and has to crop it, vertical alignment will determine which part of the page will be visible.For example, 0.5 means the center of the page will be visible, 0 means the top edge will be visible and 1 means the bottom edge will be visible.
The default vertical alignment is 0.
Added in version 1.3.
- Parameters:
yalign – the new value
- set_title(title: str) None
TabBar
will display it in the center of the tab unless it’s pinned, and will use it as a tooltip unlesstooltip
is set.TabOverview
will display it below the thumbnail unless it’s pinned, or inside the card otherwise, and will use it as a tooltip unlesstooltip
is set.Sets the title of
self
.- Parameters:
title – the title of
self
Properties
- class TabPage
-
- props.icon: Icon
The icon of the page.
TabBar
andTabOverview
display the icon next to the title, unlessloading
is set toTRUE
.AdwTabBar
also won’t show the icon if the page is pinned and [propertyTabPage:indicator-icon] is set.
- props.indicator_activatable: bool
Whether the indicator icon is activatable.
If set to
TRUE
,indicator_activated
will be emitted when the indicator icon is clicked.If
indicator_icon
is not set, does nothing.
- props.indicator_icon: Icon
An indicator icon for the page.
A common use case is an audio or camera indicator in a web browser.
TabBar
will show it at the beginning of the tab, alongside icon representingicon
or loading spinner.If the page is pinned, the indicator will be shown instead of icon or spinner.
TabOverview
will show it at the at the top part of the thumbnail.indicator_tooltip
can be used to set the tooltip on the indicator icon.If
indicator_activatable
is set toTRUE
, the indicator icon can act as a button.
- props.indicator_tooltip: str
The tooltip of the indicator icon.
The tooltip can be marked up with the Pango text markup language.
See
indicator_icon
.Added in version 1.2.
- props.keyword: str
The search keyboard of the page.
TabOverview
can search pages by their keywords in addition to their titles and tooltips.Keywords allow to include e.g. page URLs into tab search in a web browser.
Added in version 1.3.
- props.live_thumbnail: bool
Whether to enable live thumbnail for this page.
When set to
TRUE
, the page’s thumbnail inTabOverview
will update immediately when the page is redrawn or resized.If it’s set to
FALSE
, the thumbnail will only be live when the page is selected, and otherwise it will be static and will only update wheninvalidate_thumbnail
orinvalidate_thumbnails
is called.Added in version 1.3.
- props.loading: bool
Whether the page is loading.
If set to
TRUE
,TabBar
andTabOverview
will display a spinner in place of icon.If the page is pinned and
indicator_icon
is set, loading status will not be visible withAdwTabBar
.
- props.needs_attention: bool
Whether the page needs attention.
TabBar
will display a line under the tab representing the page if set toTRUE
. If the tab is not visible, the corresponding edge of the tab bar will be highlighted.TabOverview
will display a dot in the corner of the thumbnail if set toTRUE
.TabButton
will display a dot if any of the pages that aren’t selected have this property set toTRUE
.
- props.thumbnail_xalign: float
The horizontal alignment of the page thumbnail.
If the page is so wide that
TabOverview
can’t display it completely and has to crop it, horizontal alignment will determine which part of the page will be visible.For example, 0.5 means the center of the page will be visible, 0 means the start edge will be visible and 1 means the end edge will be visible.
The default horizontal alignment is 0.
Added in version 1.3.
- props.thumbnail_yalign: float
The vertical alignment of the page thumbnail.
If the page is so tall that
TabOverview
can’t display it completely and has to crop it, vertical alignment will determine which part of the page will be visible.For example, 0.5 means the center of the page will be visible, 0 means the top edge will be visible and 1 means the bottom edge will be visible.
The default vertical alignment is 0.
Added in version 1.3.
- props.title: str
The title of the page.
TabBar
will display it in the center of the tab unless it’s pinned, and will use it as a tooltip unlesstooltip
is set.TabOverview
will display it below the thumbnail unless it’s pinned, or inside the card otherwise, and will use it as a tooltip unlesstooltip
is set.
- props.tooltip: str
The tooltip of the page.
The tooltip can be marked up with the Pango text markup language.
If not set,
TabBar
andTabOverview
will usetitle
as a tooltip instead.