Class CenterLayout
- All Implemented Interfaces:
Proxy
Manages up to three children.
The start widget is allocated at the start of the layout (left in left-to-right locales and right in right-to-left ones), and the end widget at the end.
The center widget is centered regarding the full width of the layout's.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCenterLayout.Builder<B extends CenterLayout.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class LayoutManager
LayoutManager.LayoutManager$Impl, LayoutManager.LayoutManagerClassNested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new CenterLayout.CenterLayout(MemorySegment address) Create a CenterLayout instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected CenterLayoutasParent()Return this instance as if it were its parent type.static CenterLayout.Builder<? extends CenterLayout.Builder> builder()ACenterLayout.Builderobject constructs aCenterLayoutwith the specified properties.Returns the baseline position of the layout.@Nullable WidgetReturns the center widget of the layout.@Nullable WidgetReturns the end widget of the layout.static MemoryLayoutThe memory layout of the native struct.Gets the current orienration of the layout manager.booleanGets whether this CenterLayout shrinks the center widget after other children.@Nullable WidgetReturns the start widget of the layout.static @Nullable TypegetType()Get the GType of the CenterLayout class.voidsetBaselinePosition(BaselinePosition baselinePosition) Sets the new baseline position of this CenterLayoutvoidsetCenterWidget(@Nullable Widget widget) Sets the new center widget ofself.voidsetEndWidget(@Nullable Widget widget) Sets the new end widget ofself.voidsetOrientation(Orientation orientation) Sets the orientation ofself.voidsetShrinkCenterLast(boolean shrinkCenterLast) Sets whether to shrink the center widget after other children.voidsetStartWidget(@Nullable Widget widget) Sets the new start widget ofself.Methods inherited from class LayoutManager
allocate, createLayoutChild, getLayoutChild, getRequestMode, getRequestMode, getWidget, layoutChanged, measure, root, unrootMethods inherited from class 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, 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, withPropertiesMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
CenterLayout
Create a CenterLayout instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
CenterLayout
public CenterLayout()Create a new CenterLayout.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code.- Overrides:
asParentin classLayoutManager- Returns:
- the instance as if it were its parent type
-
getBaselinePosition
Returns the baseline position of the layout.- Returns:
- The current baseline position of
self.
-
getCenterWidget
Returns the center widget of the layout.- Returns:
- the current center widget of this CenterLayout
-
getEndWidget
Returns the end widget of the layout.- Returns:
- the current end widget of this CenterLayout
-
getOrientation
Gets the current orienration of the layout manager.- Returns:
- The current orientation of this CenterLayout
-
getShrinkCenterLast
public boolean getShrinkCenterLast()Gets whether this CenterLayout shrinks the center widget after other children.- Returns:
- whether to shrink the center widget after others
- Since:
- 4.12
-
getStartWidget
Returns the start widget of the layout.- Returns:
- The current start widget of this CenterLayout
-
setBaselinePosition
Sets the new baseline position of this CenterLayout- Parameters:
baselinePosition- the new baseline position
-
setCenterWidget
Sets the new center widget of
self.To remove the existing center widget, pass
null.- Parameters:
widget- the new center widget
-
setEndWidget
Sets the new end widget of
self.To remove the existing center widget, pass
null.- Parameters:
widget- the new end widget
-
setOrientation
Sets the orientation ofself.- Parameters:
orientation- the new orientation
-
setShrinkCenterLast
public void setShrinkCenterLast(boolean shrinkCenterLast) Sets whether to shrink the center widget after other children.
By default, when there's no space to give all three children their natural widths, the start and end widgets start shrinking and the center child keeps natural width until they reach minimum width.
If set to
FALSE, start and end widgets keep natural width and the center widget starts shrinking instead.- Parameters:
shrinkCenterLast- whether to shrink the center widget after others- Since:
- 4.12
-
setStartWidget
Sets the new start widget of
self.To remove the existing start widget, pass
null.- Parameters:
widget- the new start widget
-
builder
ACenterLayout.Builderobject constructs aCenterLayoutwith the specified properties. Use the variousset...()methods to set properties, and finish construction withCenterLayout.Builder.build().- Returns:
- the builder object
-