Package ch.bailu.gtk.adw
Class ClampLayout
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.LayoutManager
ch.bailu.gtk.adw.ClampLayout
- All Implemented Interfaces:
PointerInterface
A layout manager constraining its children to a given size.
<picture>
<source srcset="clamp-wide-dark.png" media="(prefers-color-scheme: dark)">
<img src="clamp-wide.png" alt="clamp-wide">
</picture>
<picture>
<source srcset="clamp-narrow-dark.png" media="(prefers-color-scheme: dark)">
<img src="clamp-narrow.png" alt="clamp-narrow">
</picture>
`AdwClampLayout` constraints the size of the widgets it contains to a given
maximum size. It will constrain the width if it is horizontal, or the height
if it is vertical. The expansion of the children from their minimum to their
maximum size is eased out for a smooth transition.
If a child requires more than the requested maximum size, it will be
allocated the minimum size it can fit in instead.
Each child will get the style classes .large when it reached its maximum
size, .small when it's allocated the full size, .medium in-between, or none
if it hasn't been allocated yet.
<picture>
<source srcset="clamp-wide-dark.png" media="(prefers-color-scheme: dark)">
<img src="clamp-wide.png" alt="clamp-wide">
</picture>
<picture>
<source srcset="clamp-narrow-dark.png" media="(prefers-color-scheme: dark)">
<img src="clamp-narrow.png" alt="clamp-narrow">
</picture>
`AdwClampLayout` constraints the size of the widgets it contains to a given
maximum size. It will constrain the width if it is horizontal, or the height
if it is vertical. The expansion of the children from their minimum to their
maximum size is eased out for a smooth transition.
If a child requires more than the requested maximum size, it will be
allocated the minimum size it can fit in instead.
Each child will get the style classes .large when it reached its maximum
size, .small when it's allocated the full size, .medium in-between, or none
if it hasn't been allocated yet.
https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ClampLayout.html
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceOrientable
.static ClassHandler
static int
int
Gets the maximum size allocated to the children.static long
static TypeSystem.TypeSize
int
Gets the size above which the children are clamped.static long
static TypeSystem.TypeSize
void
setMaximumSize
(int maximum_size) Sets the maximum size allocated to the children.void
setTighteningThreshold
(int tightening_threshold) Sets the size above which the children are clamped.Methods inherited from class ch.bailu.gtk.gtk.LayoutManager
allocate, getLayoutChild, getRequestMode, getWidget, layoutChanged, measure
Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
ClampLayout
-
ClampLayout
public ClampLayout()Creates a new `AdwClampLayout`.
-
-
Method Details
-
getClassHandler
-
getMaximumSize
public int getMaximumSize()Gets the maximum size allocated to the children.- Returns:
- the maximum size to allocate to the children
-
getTighteningThreshold
public int getTighteningThreshold()Gets the size above which the children are clamped.- Returns:
- the size above which the children are clamped
-
setMaximumSize
public void setMaximumSize(int maximum_size) Sets the maximum size allocated to the children.
It is the width if the layout is horizontal, or the height if it is vertical.- Parameters:
maximum_size
- the maximum size
-
setTighteningThreshold
public void setTighteningThreshold(int tightening_threshold) Sets the size above which the children are clamped.
Starting from this size, the layout will tighten its grip on the children,
slowly allocating less and less of the available size up to the maximum
allocated size. Below that threshold and below the maximum size, the children
will be allocated all the available size.
If the threshold is greater than the maximum size to allocate to the
children, they will be allocated the whole size up to the maximum. If the
threshold is lower than the minimum size to allocate to the children, that
size will be used as the tightening threshold.
Effectively, tightening the grip on a child before it reaches its maximum
size makes transitions to and from the maximum size smoother when resizing.- Parameters:
tightening_threshold
- the tightening threshold
-
asOrientable
Implements interfaceOrientable
. Call this to get access to interface functions.- Returns:
Orientable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-