Adw.InlineViewSwitcher¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (17), Gtk.Buildable (1), Gtk.Orientable (2)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Adw.InlineViewSwitcher(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A view switcher that uses a toggle group.
<picture> <source srcset=”inline-view-switcher-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”inline-view-switcher.png” alt=”inline-view-switcher”> </picture>
A view switcher showing pages of an [class`ViewStack`] within an [class`ToggleGroup`], similar to [class`ViewSwitcher`].
The toggles can display either an icon, a label or both. Use the [property`InlineViewSwitcher`:py:data::display-mode<Adw.InlineViewSwitcher.props.display_mode>] to control this.
<picture> <source srcset=”inline-view-switcher-display-modes-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”inline-view-switcher-display-modes.png” alt=”inline-view-switcher-display-modes”> </picture>
- CSS nodes
AdwInlineViewSwitcher
has a single CSS node with the nameinline-view-switcher
.- Style classes
Like
AdwToggleGroup
, it can accept the .flat and .round style classes.<picture> <source srcset=”inline-view-switcher-style-classes-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”inline-view-switcher-style-classes.png” alt=”inline-view-switcher-style-classes”> </picture>
- Accessibility
The internal toggle group uses the
GTK_ACCESSIBLE_ROLE_TAB_LIST
role. Its toggles use theGTK_ACCESSIBLE_ROLE_TAB
role.New in version 1.7.
- classmethod new()¶
- Returns:
the newly created
AdwInlineViewSwitcher
- Return type:
Creates a new
AdwInlineViewSwitcher
.New in version 1.7.
- get_can_shrink()¶
- Returns:
whether the toggles can shrink
- Return type:
Gets whether the toggles can be smaller than the natural size of their contents.
New in version 1.7.
- get_display_mode()¶
- Returns:
the display mode
- Return type:
Gets the display mode of self.
New in version 1.7.
- get_homogeneous()¶
- Returns:
whether all toggles take the same size
- Return type:
Gets whether all toggles within self take the same size.
New in version 1.7.
- get_stack()¶
- Returns:
The stack of self
- Return type:
Gets the stack self controls.
New in version 1.7.
- set_can_shrink(can_shrink)¶
- Parameters:
can_shrink (
bool
) – whether the toggles can shrink
Sets whether the toggles can be smaller than the natural size of their contents.
If can_shrink is
TRUE
, the toggle labels will ellipsize.See [property`ToggleGroup`:py:data::can-shrink<Adw.InlineViewSwitcher.props.can_shrink>].
New in version 1.7.
- set_display_mode(mode)¶
- Parameters:
mode (
Adw.InlineViewSwitcherDisplayMode
) – the display mode
Sets the display mode of self.
Determines what the toggles display: a label, an icon or both.
<picture> <source srcset=”inline-view-switcher-display-modes-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”inline-view-switcher-display-modes.png” alt=”inline-view-switcher-display-modes”> </picture>
New in version 1.7.
- set_homogeneous(homogeneous)¶
- Parameters:
homogeneous (
bool
) – whether all toggles should take the same size
Sets whether all toggles within self take the same size.
New in version 1.7.
- set_stack(stack)¶
- Parameters:
stack (
Adw.ViewStack
orNone
) – a stack
Sets the stack to control.
New in version 1.7.
Property Details¶
- Adw.InlineViewSwitcher.props.can_shrink¶
- Name:
can-shrink
- Type:
- Default Value:
- Flags:
Whether the toggles can be smaller than the natural size of their contents.
If set to
TRUE
, the toggle labels will ellipsize.See [property`ToggleGroup`:py:data::can-shrink<Adw.InlineViewSwitcher.props.can_shrink>].
New in version 1.7.
- Adw.InlineViewSwitcher.props.display_mode¶
- Name:
display-mode
- Type:
- Default Value:
- Flags:
The display mode.
Determines what the toggles display: a label, an icon or both.
<picture> <source srcset=”inline-view-switcher-display-modes-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”inline-view-switcher-display-modes.png” alt=”inline-view-switcher-display-modes”> </picture>
New in version 1.7.
- Adw.InlineViewSwitcher.props.homogeneous¶
- Name:
homogeneous
- Type:
- Default Value:
- Flags:
Whether all toggles take the same size.
New in version 1.7.
- Adw.InlineViewSwitcher.props.stack¶
- Name:
stack
- Type:
- Default Value:
- Flags:
The stack the view switcher controls.
New in version 1.7.