From 6643584d5a65aefedc2af467a669479bc8e24569 Mon Sep 17 00:00:00 2001 From: Maic Siemering Date: Wed, 10 Jan 2024 21:40:37 +0100 Subject: [PATCH] Update braking change notes and remove unused size_hint_min from UILayouts --- arcade/gui/widgets/layout.py | 12 ++++-------- doc/programming_guide/release_notes.rst | 8 ++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/arcade/gui/widgets/layout.py b/arcade/gui/widgets/layout.py index e04228c45..5a7631393 100644 --- a/arcade/gui/widgets/layout.py +++ b/arcade/gui/widgets/layout.py @@ -189,7 +189,8 @@ class UIBoxLayout(UILayout): Or use :py:meth:`arcade.gui.UIBoxLayout.fit_content` to resize the layout. The bottom-left corner is used as the default anchor point. - Supports the options: ``size_hint``, ``size_hint_min``, ``size_hint_max``. + Supports the options: ``size_hint``, ``size_hint_min``, ``size_hint_max``. ``size_hint_min`` is automatically + updated based on the minimal required space by children. If a child widget provides a ``size_hint`` for a dimension, the child will be resized within the given range of ``size_hint_min`` and @@ -208,7 +209,6 @@ class UIBoxLayout(UILayout): :param size_hint: Size hint for the :py:class:`~arcade.gui.UILayout` if the widget would like to grow. Defaults to ``0, 0`` -> minimal size to contain children. - :param size_hint_min: Minimum width and height in pixels. :param size_hint_max: Maximum width and height in pixels. :param space_between: Space in pixels between the children. """ @@ -223,7 +223,6 @@ def __init__( align="center", children: Iterable[UIWidget] = tuple(), size_hint=(0, 0), - size_hint_min=None, size_hint_max=None, space_between=0, style=None, @@ -236,7 +235,6 @@ def __init__( height=height, children=children, size_hint=size_hint, - size_hint_min=size_hint_min, size_hint_max=size_hint_max, style=style, **kwargs @@ -472,7 +470,8 @@ class UIGridLayout(UILayout): ``size_hint_max``. Children are resized based on ``size_hint``. Maximum and minimum - ``size_hint``s only take effect if a ``size_hint`` is given. + ``size_hint``s only take effect if a ``size_hint`` is given. ``size_hint_min`` is automatically + updated based on the minimal required space by children. :param x: ``x`` coordinate of bottom left corner. :param y: ``y`` coordinate of bottom left corner. @@ -485,7 +484,6 @@ class UIGridLayout(UILayout): added later. :param size_hint: A size hint for :py:class:`~arcade.gui.UILayout`, if the :py:class:`~arcade.gui.UIWidget` would like to grow. - :param size_hint_min: Minimum width and height in pixels. :param size_hint_max: Maximum width and height in pixels. :param horizontal_spacing: Space between columns. :param vertical_spacing: Space between rows. @@ -503,7 +501,6 @@ def __init__( align_vertical="center", children: Iterable[UIWidget] = tuple(), size_hint=(0, 0), - size_hint_min=None, size_hint_max=None, horizontal_spacing: int = 0, vertical_spacing: int = 0, @@ -520,7 +517,6 @@ def __init__( height=0, children=children, size_hint=size_hint, - size_hint_min=size_hint_min, size_hint_max=size_hint_max, style=style, **kwargs diff --git a/doc/programming_guide/release_notes.rst b/doc/programming_guide/release_notes.rst index 4123ae70d..84ecc1515 100644 --- a/doc/programming_guide/release_notes.rst +++ b/doc/programming_guide/release_notes.rst @@ -48,6 +48,14 @@ API in a way that is not compatible with how it was used in 2.6. * The GUI package has been changed significantly. * Buffered shapes (shape list items) have been moved to their own sub-module. * `use_spatial_hash` parameter for `SpriteList` and `TileMap` is now a `bool` instead of `Optional[bool]` +* GUI + + * Removed :py:class:`~arcade.gui.widgets.UIWrapper` this is now general available in :py:class:`~arcade.gui.widgets.UILayout` + * Removed :py:class:`~arcade.gui.widgets.UIBorder` this is now general available in :py:class:`~arcade.gui.widgets.UIWidget` + * Removed :py:class:`~arcade.gui.widgets.UIPadding` this is now general available in :py:class:`~arcade.gui.widgets.UIWidget` + * Removed :py:class:`~arcade.gui.widgets.UITexturePane` this is now general available in :py:class:`~arcade.gui.widgets.UIWidget` + * Removed :py:class:`~arcade.gui.widgets.UIAnchorWidget` replaced by :py:class:`~arcade.gui.widgets.UIAnchorLayout` + Featured Updates ~~~~~~~~~~~~~~~~