InlineViewSwitcher#

Added in version 1.7.

class InlineViewSwitcher(**properties: Any)#

Superclasses: Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, Buildable, ConstraintTarget, Orientable

A view switcher that uses a toggle group.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/inline-view-switcher.png

A view switcher showing pages of an ViewStack within an ToggleGroup, similar to ViewSwitcher.

The toggles can display either an icon, a label or both. Use the display_mode to control this.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/inline-view-switcher-display-modes.png

CSS nodes#

AdwInlineViewSwitcher has a single CSS node with the name inline-view-switcher.

Style classes#

Like AdwToggleGroup, it can accept the `.flat <style-classes.html#flat_1>`__ and `.round <style-classes.html#round>`__ style classes.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/inline-view-switcher-style-classes.png

Accessibility#

The internal toggle group uses the tab-list role. Its toggles use the tab role.

See also: ViewSwitcher, ViewSwitcherBar, ViewSwitcherSidebar.

Constructors#

class InlineViewSwitcher
classmethod new() Widget#

Creates a new AdwInlineViewSwitcher.

Added in version 1.7.

Methods#

class InlineViewSwitcher
get_can_shrink() bool#

Gets whether the toggles can be smaller than the natural size of their contents.

Added in version 1.7.

get_display_mode() InlineViewSwitcherDisplayMode#

Gets the display mode of self.

Added in version 1.7.

get_homogeneous() bool#

Gets whether all toggles within self take the same size.

Added in version 1.7.

get_stack() ViewStack | None#

Gets the stack self controls.

Added in version 1.7.

set_can_shrink(can_shrink: bool) None#

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 can_shrink.

Added in version 1.7.

Parameters:

can_shrink – whether the toggles can shrink

set_display_mode(mode: InlineViewSwitcherDisplayMode) None#

Sets the display mode of self.

Determines what the toggles display: a label, an icon or both.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/inline-view-switcher-display-modes.png

Added in version 1.7.

Parameters:

mode – the display mode

set_homogeneous(homogeneous: bool) None#

Sets whether all toggles within self take the same size.

Added in version 1.7.

Parameters:

homogeneous – whether all toggles should take the same size

set_stack(stack: ViewStack | None = None) None#

Sets the stack to control.

Added in version 1.7.

Parameters:

stack – a stack

Properties#

class InlineViewSwitcher
props.can_shrink: bool#

The type of the None singleton.

Added in version 1.7.

props.display_mode: InlineViewSwitcherDisplayMode#

The type of the None singleton.

Added in version 1.7.

props.homogeneous: bool#

The type of the None singleton.

Added in version 1.7.

props.stack: ViewStack#

The type of the None singleton.

Added in version 1.7.