Klasse ViewSwitcherTitle

Alle implementierten Schnittstellen:
PointerInterface

public class ViewSwitcherTitle extends Widget
A view switcher title.

<picture>
<source srcset="view-switcher-title-dark.png" media="(prefers-color-scheme: dark)">
<img src="view-switcher-title.png" alt="view-switcher-title">
</picture>

A widget letting you switch between multiple views contained by a
[class@ViewStack] via an [class@ViewSwitcher].

It is designed to be used as the title widget of a [class@HeaderBar], and
will display the window's title when the window is too narrow to fit the view
switcher e.g. on mobile phones, or if there are less than two views.

In order to center the title in narrow windows, the header bar should have
[property@HeaderBar:centering-policy] set to
`ADW_CENTERING_POLICY_STRICT`.

`AdwViewSwitcherTitle` is intended to be used together with
[class@ViewSwitcherBar].

A common use case is to bind the [property@ViewSwitcherBar:reveal] property
to [property@ViewSwitcherTitle:title-visible] to automatically reveal the
view switcher bar when the title label is displayed in place of the view
switcher, as follows:

```xml
<object class="AdwWindow">
<property name="content">
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar">
<property name="centering-policy">strict</property>
<property name="title-widget">
<object class="AdwViewSwitcherTitle" id="title">
<property name="stack">stack</property>
</object>
</property>
</object>
</child>
<property name="content">
<object class="AdwViewStack" id="stack"/>
</property>
<child type="bottom">
<object class="AdwViewSwitcherBar">
<property name="stack">stack</property>
<binding name="reveal">
<lookup name="title-visible">title</lookup>
</binding>
</object>
</child>
</object>
</property>
</object>
```

## CSS nodes

`AdwViewSwitcherTitle` has a single CSS node with name `viewswitchertitle`.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ViewSwitcherTitle.html

  • Konstruktordetails

    • ViewSwitcherTitle

      public ViewSwitcherTitle(PointerContainer pointer)
    • ViewSwitcherTitle

      @Deprecated public ViewSwitcherTitle()
      Veraltet.
      Creates a new `AdwViewSwitcherTitle`.
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getStack

      @Deprecated public ViewStack getStack()
      Veraltet.
      Gets the stack controlled by @self.
      Gibt zurück:
      the stack
    • getSubtitle

      @Deprecated public Str getSubtitle()
      Veraltet.
      Gets the subtitle of @self.
      Gibt zurück:
      the subtitle
    • getTitle

      @Deprecated public Str getTitle()
      Veraltet.
      Gets the title of @self.
      Gibt zurück:
      the title
    • getTitleVisible

      @Deprecated public boolean getTitleVisible()
      Veraltet.
      Gets whether the title of @self is currently visible.

      If the title is visible, it means the view switcher is hidden an it may be
      wanted to show an alternative switcher, e.g. a [class@ViewSwitcherBar].
      Gibt zurück:
      whether the title of @self is currently visible
    • getViewSwitcherEnabled

      @Deprecated public boolean getViewSwitcherEnabled()
      Veraltet.
      Gets whether @self's view switcher is enabled.
      Gibt zurück:
      whether the view switcher is enabled
    • setStack

      @Deprecated public void setStack(@Nullable ViewStack stack)
      Veraltet.
      Sets the stack controlled by @self.
      Parameter:
      stack - a stack
    • setSubtitle

      @Deprecated public void setSubtitle(@Nonnull Str subtitle)
      Veraltet.
      Sets the subtitle of @self.

      The subtitle should give the user additional details.
      Parameter:
      subtitle - a subtitle
    • setSubtitle

      @Deprecated public void setSubtitle(String subtitle)
      Veraltet.
      Sets the subtitle of @self.

      The subtitle should give the user additional details.
      Parameter:
      subtitle - a subtitle
    • setTitle

      @Deprecated public void setTitle(@Nonnull Str title)
      Veraltet.
      Sets the title of @self.

      The title typically identifies the current view or content item, and
      generally does not use the application name.
      Parameter:
      title - a title
    • setTitle

      @Deprecated public void setTitle(String title)
      Veraltet.
      Sets the title of @self.

      The title typically identifies the current view or content item, and
      generally does not use the application name.
      Parameter:
      title - a title
    • setViewSwitcherEnabled

      @Deprecated public void setViewSwitcherEnabled(boolean enabled)
      Veraltet.
      Sets whether @self's view switcher is enabled.

      If it is disabled, the title will be displayed instead. This allows to
      programmatically hide the view switcher even if it fits in the available
      space.

      This can be used e.g. to ensure the view switcher is hidden below a certain
      window width, or any other constraint you find suitable.
      Parameter:
      enabled - whether the view switcher is enabled
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Setzt außer Kraft:
      asAccessible in Klasse Widget
      Gibt zurück:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Setzt außer Kraft:
      asBuildable in Klasse Widget
      Gibt zurück:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Setzt außer Kraft:
      asConstraintTarget in Klasse Widget
      Gibt zurück:
      ConstraintTarget
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()