Klasse MultiLayoutView

Alle implementierten Schnittstellen:
PointerInterface

public class MultiLayoutView extends Widget
A widget for switching between different layouts.

`AdwMultiLayoutView` contains layouts and children. Each child has
an ID, each layout has slots inside it, each slot also has an ID. When
switching layouts, children are inserted into slots with matching IDs. The
[property@Gtk.Widget:visible] property of each slot is updated to match
that of the inserted child.

This can be useful for rearranging children when it's difficult to do so
otherwise, for example to move a child from a sidebar to a bottom bar.

The currently used layout can be switched using the
[property@MultiLayoutView:layout] or [property@MultiLayoutView:layout-name]
properties. For example, it can be done via a [class@Adw.Breakpoint] setter
to change layouts depending on the window size.

## AdwMultiLayoutView as GtkBuildable

The `AdwMultiLayoutView` implementation of the [iface@Gtk.Buildable]
interface supports adding layouts via `<child>` element with the `type`
attribute omitted.

It also supports setting children via `<child type="ID">`.

Example of an `AdwMultiLayoutView` UI definition that can display a secondary
child as either a sidebar or a bottom sheet.

```xml
<object class="AdwMultiLayoutView">
<child>
<object class="AdwLayout">
<property name="name">sidebar</property>
<property name="content">
<object class="AdwOverlaySplitView">
<property name="sidebar">
<object class="AdwLayoutSlot">
<property name="id">secondary</property>
</object>
</property>
<property name="content">
<object class="AdwLayoutSlot">
<property name="id">primary</property>
</object>
</property>
</object>
</property>
</object>
</child>
<child>
<object class="AdwLayout">
<property name="name">bottom-sheet</property>
<property name="content">
<object class="AdwBottomSheet">
<property name="open">True</property>
<property name="content">
<object class="AdwLayoutSlot">
<property name="id">primary</property>
</object>
</property>
<property name="sheet">
<object class="AdwLayoutSlot">
<property name="id">secondary</property>
</object>
</property>
</object>
</property>
</object>
</child>
<child type="primary">
<!-- ... -->
</child>
<child type="secondary">
<!-- ... -->
</child>
</object>
```

## CSS nodes

`AdwMultiLayoutView` has a single CSS node with name `multi-layout-view`.

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

  • Konstruktordetails

    • MultiLayoutView

      public MultiLayoutView(PointerContainer pointer)
    • MultiLayoutView

      public MultiLayoutView()
      Creates a new `AdwMultiLayoutView`.
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • addLayout

      public void addLayout(@Nonnull Layout layout)
      Adds @layout to @self.
      Parameter:
      layout - the layout to add
    • getChild

      public Widget getChild(@Nonnull Str id)
      Gets the child for @id to @self.
      Parameter:
      id - the id of the child
      Gibt zurück:
      the child for @id
    • getChild

      public Widget getChild(String id)
      Gets the child for @id to @self.
      Parameter:
      id - the id of the child
      Gibt zurück:
      the child for @id
    • getLayout

      public Layout getLayout()
      Gets the currently used layout of @self.
      Gibt zurück:
      the current layout
    • getLayoutByName

      public Layout getLayoutByName(@Nonnull Str name)
      Gets layout with the name @name from @self, or `NULL` if it doesn't exist.

      See [property@Layout:name].
      Parameter:
      name - the name of the layout
      Gibt zurück:
      the layout with @name
    • getLayoutByName

      public Layout getLayoutByName(String name)
      Gets layout with the name @name from @self, or `NULL` if it doesn't exist.

      See [property@Layout:name].
      Parameter:
      name - the name of the layout
      Gibt zurück:
      the layout with @name
    • getLayoutName

      public Str getLayoutName()
      Returns the name of the currently used layout of @self.
      Gibt zurück:
      the name of the current layout
    • removeLayout

      public void removeLayout(@Nonnull Layout layout)
      Removes @layout from @self.
      Parameter:
      layout - the layout to add
    • setChild

      public void setChild(@Nonnull Str id, @Nonnull Widget child)
      Sets @child as the child for @id in @self.

      When changing layouts, it will be inserted into the slot with @id.
      Parameter:
      id - the id of the child
      child - the child to set
    • setChild

      public void setChild(String id, @Nonnull Widget child)
      Sets @child as the child for @id in @self.

      When changing layouts, it will be inserted into the slot with @id.
      Parameter:
      id - the id of the child
      child - the child to set
    • setLayout

      public void setLayout(@Nonnull Layout layout)
      Makes @layout the current layout of @self.
      Parameter:
      layout - a layout in @self
    • setLayoutName

      public void setLayoutName(@Nonnull Str name)
      Makes the layout with @name the current layout of @self.

      See [property@Layout:name].
      Parameter:
      name - the name of the layout
    • setLayoutName

      public void setLayoutName(String name)
      Makes the layout with @name the current layout of @self.

      See [property@Layout:name].
      Parameter:
      name - the name of the layout
    • 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()