It derives from <GtkWidget>.
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 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
MultiLayoutView:layout or MultiLayoutView:layout-name
properties. For example, it can be done via a
<AdwBreakpoint> setter to change layouts
depending on the window size.
The <AdwMultiLayoutView> implementation of
the <GtkBuildable> 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.
<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>
<AdwMultiLayoutView> has a single CSS node
with name multi-layout-view.
The currently used layout.
Its value is a <AdwLayout>, or #f.
Set it with (set! (multi-layout-view:layout self) value).
The name of the currently used layout.
See Layout:name.
Its value is a string, or #f.
Set it with (set! (multi-layout-view:layout-name self) value).
Adds layout to self.
Passed: a <AdwMultiLayoutView>.
a multi-layout view
Passed: a <AdwLayout>.
the layout to add
Gets the child for id to self.
Passed: a <AdwMultiLayoutView>.
a multi-layout view
Passed: a string.
the id of the child
Returned: a <GtkWidget>, or #f.
the child for id
Gets the currently used layout of self.
Passed: a <AdwMultiLayoutView>.
a multi-layout view
Returned: a <AdwLayout>, or #f.
the current layout
Gets layout with the name name from self, or NULL if
it doesn’t exist.
See Layout:name.
Passed: a <AdwMultiLayoutView>.
a multi-layout view
Passed: a string.
the name of the layout
Returned: a <AdwLayout>, or #f.
the layout with name
Returns the name of the currently used layout of self.
Passed: a <AdwMultiLayoutView>.
a multi-layout view
Returned: a string, or #f.
the name of the current layout
Creates a new <AdwMultiLayoutView>.
Returned: a <GtkWidget>.
the newly created <AdwMultiLayoutView>
Removes layout from self.
Passed: a <AdwMultiLayoutView>.
a multi-layout view
Passed: a <AdwLayout>.
the layout to add
Sets child as the child for id in self.
When changing layouts, it will be inserted into the slot with id.
Passed: a <AdwMultiLayoutView>.
a multi-layout view
Passed: a string.
the id of the child
Passed: a <GtkWidget>.
the child to set
Makes layout the current layout of self.
Passed: a <AdwMultiLayoutView>.
a multi-layout view
Passed: a <AdwLayout>.
a layout in self
Makes the layout with name the current layout of self.
See Layout:name.
Passed: a <AdwMultiLayoutView>.
a multi-layout view
Passed: a string.
the name of the layout