Adw.InlineViewSwitcher

g Adw.InlineViewSwitcher Adw.InlineViewSwitcher GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Orientable->Adw.InlineViewSwitcher Gtk.Widget->Adw.InlineViewSwitcher

Subclasses:

None

Methods

Inherited:

Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (17), Gtk.Buildable (1), Gtk.Orientable (2)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

get_can_shrink ()

get_display_mode ()

get_homogeneous ()

get_stack ()

set_can_shrink (can_shrink)

set_display_mode (mode)

set_homogeneous (homogeneous)

set_stack (stack)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (35), Gtk.Accessible (1), Gtk.Orientable (1)

Name

Type

Flags

Short Description

can-shrink

bool

r/w/en

display-mode

Adw.InlineViewSwitcherDisplayMode

r/w/en

homogeneous

bool

r/w/en

stack

Adw.ViewStack

r/w/en

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class Adw.InlineViewSwitcher(**kwargs)
Bases:

Gtk.Widget, Gtk.Orientable

Abstract:

No

Structure:

Adw.InlineViewSwitcherClass

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 name inline-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 the GTK_ACCESSIBLE_ROLE_TAB role.

New in version 1.7.

classmethod new()
Returns:

the newly created AdwInlineViewSwitcher

Return type:

Gtk.Widget

Creates a new AdwInlineViewSwitcher.

New in version 1.7.

get_can_shrink()
Returns:

whether the toggles can shrink

Return type:

bool

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:

Adw.InlineViewSwitcherDisplayMode

Gets the display mode of self.

New in version 1.7.

get_homogeneous()
Returns:

whether all toggles take the same size

Return type:

bool

Gets whether all toggles within self take the same size.

New in version 1.7.

get_stack()
Returns:

The stack of self

Return type:

Adw.ViewStack or None

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 or None) – a stack

Sets the stack to control.

New in version 1.7.

Property Details

Adw.InlineViewSwitcher.props.can_shrink
Name:

can-shrink

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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:

Adw.InlineViewSwitcherDisplayMode

Default Value:

Adw.InlineViewSwitcherDisplayMode.LABELS

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether all toggles take the same size.

New in version 1.7.

Adw.InlineViewSwitcher.props.stack
Name:

stack

Type:

Adw.ViewStack

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The stack the view switcher controls.

New in version 1.7.