:right-sidebar: True Squeezer =================================================================== .. currentmodule:: gi.repository.Adw .. deprecated:: 1.4 See `the migration guide `__ .. class:: Squeezer(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget`, :class:`~gi.repository.Gtk.Orientable` A best fit container. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/squeezer-narrow.png The ``AdwSqueezer`` widget is a container which only shows the first of its children that fits in the available size. It is convenient to offer different widgets to represent the same data with different levels of detail, making the widget seem to squeeze itself to fit in the available space. Transitions between children can be animated as fades. This can be controlled with :obj:`~gi.repository.Adw.Squeezer.props.transition_type`\. CSS nodes -------------------------------------------------------------------------------- ``AdwSqueezer`` has a single CSS node with name ``squeezer``\. Constructors ------------ .. rst-class:: interim-class .. class:: Squeezer :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``AdwSqueezer``\. .. deprecated:: 1.4 See `the migration guide `__ Methods ------- .. rst-class:: interim-class .. class:: Squeezer :no-index: .. method:: add(child: ~gi.repository.Gtk.Widget) -> ~gi.repository.Adw.SqueezerPage Adds a child to ``self``\. .. deprecated:: 1.4 See `the migration guide `__ :param child: the widget to add .. method:: get_allow_none() -> bool Gets whether to allow squeezing beyond the last child's minimum size. .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_homogeneous() -> bool Gets whether all children have the same size for the opposite orientation. .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_interpolate_size() -> bool Gets whether ``self`` interpolates its size when changing the visible child. .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_page(child: ~gi.repository.Gtk.Widget) -> ~gi.repository.Adw.SqueezerPage Returns the :obj:`~gi.repository.Adw.SqueezerPage` object for ``child``\. .. deprecated:: 1.4 See `the migration guide `__ :param child: a child of ``self`` .. method:: get_pages() -> ~gi.repository.Gtk.SelectionModel Returns a :obj:`~gi.repository.Gio.ListModel` that contains the pages of ``self``\. This can be used to keep an up-to-date view. The model also implements :obj:`~gi.repository.Gtk.SelectionModel` and can be used to track the visible page. .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_switch_threshold_policy() -> ~gi.repository.Adw.FoldThresholdPolicy Gets the switch threshold policy for ``self``\. .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_transition_duration() -> int Gets the transition animation duration for ``self``\. .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_transition_running() -> bool Gets whether a transition is currently running for ``self``\. If a transition is impossible, the property value will be set to ``TRUE`` and then immediately to ``FALSE``\, so it's possible to rely on its notifications to know that a transition has happened. .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_transition_type() -> ~gi.repository.Adw.SqueezerTransitionType Gets the type of animation used for transitions between children in ``self``\. .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_visible_child() -> ~gi.repository.Gtk.Widget | None Gets the currently visible child of ``self``\. .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_xalign() -> float Gets the horizontal alignment, from 0 (start) to 1 (end). .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_yalign() -> float Gets the vertical alignment, from 0 (top) to 1 (bottom). .. deprecated:: 1.4 See `the migration guide `__ .. method:: remove(child: ~gi.repository.Gtk.Widget) -> None Removes a child widget from ``self``\. .. deprecated:: 1.4 See `the migration guide `__ :param child: the child to remove .. method:: set_allow_none(allow_none: bool) -> None Sets whether to allow squeezing beyond the last child's minimum size. If set to ``TRUE``\, the squeezer can shrink to the point where no child can be shown. This is functionally equivalent to appending a widget with 0×0 minimum size. .. deprecated:: 1.4 See `the migration guide `__ :param allow_none: whether ``self`` allows squeezing beyond the last child .. method:: set_homogeneous(homogeneous: bool) -> None Sets whether all children have the same size for the opposite orientation. For example, if a squeezer is horizontal and is homogeneous, it will request the same height for all its children. If it isn't, the squeezer may change size when a different child becomes visible. .. deprecated:: 1.4 See `the migration guide `__ :param homogeneous: whether ``self`` is homogeneous .. method:: set_interpolate_size(interpolate_size: bool) -> None Sets whether ``self`` interpolates its size when changing the visible child. If ``TRUE``\, the squeezer will interpolate its size between the one of the previous visible child and the one of the new visible child, according to the set transition duration and the orientation, e.g. if the squeezer is horizontal, it will interpolate the its height. .. deprecated:: 1.4 See `the migration guide `__ :param interpolate_size: whether to interpolate the size .. method:: set_switch_threshold_policy(policy: ~gi.repository.Adw.FoldThresholdPolicy) -> None Sets the switch threshold policy for ``self``\. Determines when the squeezer will switch children. If set to ``ADW_FOLD_THRESHOLD_POLICY_MINIMUM``\, it will only switch when the visible child cannot fit anymore. With ``ADW_FOLD_THRESHOLD_POLICY_NATURAL``\, it will switch as soon as the visible child doesn't get their natural size. This can be useful if you have a long ellipsizing label and want to let it ellipsize instead of immediately switching. .. deprecated:: 1.4 See `the migration guide `__ :param policy: the policy to use .. method:: set_transition_duration(duration: int) -> None Sets the transition animation duration for ``self``\. .. deprecated:: 1.4 See `the migration guide `__ :param duration: the new duration, in milliseconds .. method:: set_transition_type(transition: ~gi.repository.Adw.SqueezerTransitionType) -> None Sets the type of animation used for transitions between children in ``self``\. .. deprecated:: 1.4 See `the migration guide `__ :param transition: the new transition type .. method:: set_xalign(xalign: float) -> None Sets the horizontal alignment, from 0 (start) to 1 (end). This affects the children allocation during transitions, when they exceed the size of the squeezer. For example, 0.5 means the child will be centered, 0 means it will keep the start side aligned and overflow the end side, and 1 means the opposite. .. deprecated:: 1.4 See `the migration guide `__ :param xalign: the new alignment value .. method:: set_yalign(yalign: float) -> None Sets the vertical alignment, from 0 (top) to 1 (bottom). This affects the children allocation during transitions, when they exceed the size of the squeezer. For example, 0.5 means the child will be centered, 0 means it will keep the top side aligned and overflow the bottom side, and 1 means the opposite. .. deprecated:: 1.4 See `the migration guide `__ :param yalign: the new alignment value Properties ---------- .. rst-class:: interim-class .. class:: Squeezer :no-index: .. attribute:: props.allow_none :type: bool The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.homogeneous :type: bool The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.interpolate_size :type: bool The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.pages :type: ~gi.repository.Gtk.SelectionModel The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.switch_threshold_policy :type: ~gi.repository.Adw.FoldThresholdPolicy The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.transition_duration :type: int The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.transition_running :type: bool The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.transition_type :type: ~gi.repository.Adw.SqueezerTransitionType The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.visible_child :type: ~gi.repository.Gtk.Widget The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.xalign :type: float The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.yalign :type: float The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__