Class MultiLayoutView
- All Implemented Interfaces:
Proxy
,Accessible
,Buildable
,ConstraintTarget
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
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
MultiLayoutView:layout
or MultiLayoutView:layout-name
properties. For example, it can be done via a Breakpoint
setter
to change layouts depending on the window size.
AdwMultiLayoutView as GtkBuildable
The AdwMultiLayoutView
implementation of the 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.
<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
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
MultiLayoutView.Builder<B extends MultiLayoutView.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.DestroyCallback, Widget.DirectionChangedCallback, Widget.HideCallback, Widget.KeynavFailedCallback, Widget.MapCallback, Widget.MnemonicActivateCallback, Widget.MoveFocusCallback, Widget.QueryTooltipCallback, Widget.RealizeCallback, Widget.ShowCallback, Widget.StateFlagsChangedCallback, Widget.UnmapCallback, Widget.UnrealizeCallback, Widget.WidgetClass, Widget.WidgetImpl
Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.AccessibleImpl, Accessible.AccessibleInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.BuildableIface, Buildable.BuildableImpl
Nested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTargetImpl, ConstraintTarget.ConstraintTargetInterface
-
Constructor Summary
ConstructorDescriptionCreates a newAdwMultiLayoutView
.MultiLayoutView
(MemorySegment address) Create a MultiLayoutView proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Addslayout
to this MultiLayoutView.protected MultiLayoutView
asParent()
Returns this instance as if it were its parent type.static MultiLayoutView.Builder
<? extends MultiLayoutView.Builder> builder()
AMultiLayoutView.Builder
object constructs aMultiLayoutView
with the specified properties.Gets the child forid
to this MultiLayoutView.Gets the currently used layout of this MultiLayoutView.getLayoutByName
(String name) Gets layout with the namename
from this MultiLayoutView, orNULL
if it doesn't exist.Returns the name of the currently used layout of this MultiLayoutView.static Type
getType()
Get the GType of the MultiLayoutView classvoid
removeLayout
(Layout layout) Removeslayout
from this MultiLayoutView.void
Setschild
as the child forid
in this MultiLayoutView.void
Makeslayout
the current layout of this MultiLayoutView.void
setLayoutName
(String name) Makes the layout withname
the current layout of this MultiLayoutView.Methods inherited from class org.gnome.gtk.Widget
actionSetEnabled, activateActionIfExists, activateDefault, activateWidget, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, cssChanged, directionChanged, disposeTemplate, dragCheckThreshold, emitDestroy, emitDirectionChanged, emitHide, emitKeynavFailed, emitMap, emitMnemonicActivate, emitMoveFocus, emitQueryTooltip, emitRealize, emitShow, emitStateFlagsChanged, emitUnmap, emitUnrealize, errorBell, focus, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getMemoryLayout, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, moveFocus, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, pick, queryTooltip, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, root, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, sizeAllocate, snapshot, snapshotChild, stateFlagsChanged, systemSettingChanged, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unroot, unsetStateFlags, unsetStateFlags
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updateProperty, updateRelation, updateState
Methods inherited from interface org.gnome.gtk.Buildable
getBuildableId
-
Constructor Details
-
MultiLayoutView
Create a MultiLayoutView proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
MultiLayoutView
public MultiLayoutView()Creates a newAdwMultiLayoutView
.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
addLayout
Addslayout
to this MultiLayoutView.- Parameters:
layout
- the layout to add
-
getChild
-
getLayout
Gets the currently used layout of this MultiLayoutView.- Returns:
- the current layout
-
getLayoutByName
-
getLayoutName
Returns the name of the currently used layout of this MultiLayoutView.- Returns:
- the name of the current layout
-
removeLayout
Removeslayout
from this MultiLayoutView.- Parameters:
layout
- the layout to add
-
setChild
-
setLayout
Makeslayout
the current layout of this MultiLayoutView.- Parameters:
layout
- a layout in this MultiLayoutView
-
setLayoutName
Makes the layout withname
the current layout of this MultiLayoutView.See
Layout:name
.- Parameters:
name
- the name of the layout
-
builder
AMultiLayoutView.Builder
object constructs aMultiLayoutView
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withMultiLayoutView.Builder.build()
.
-