classref: Sync with latest 4.0-dev

This commit is contained in:
Rémi Verschelde
2021-10-05 16:09:21 +02:00
parent 6952796767
commit f6f6c1bf19
958 changed files with 113054 additions and 52009 deletions

View File

@@ -18,26 +18,96 @@ Description
Adds a top, left, bottom, and right margin to all :ref:`Control<class_Control>` nodes that are direct children of the container. To control the ``MarginContainer``'s margin, use the ``margin_*`` theme properties listed below.
**Note:** Be careful, :ref:`Control<class_Control>` margin values are different than the constant margin values. If you want to change the custom margin values of the ``MarginContainer`` by code, you should use the following examples:
**Note:** Be careful, :ref:`Control<class_Control>` margin values are different from the constant margin values. If you want to change the custom margin values of the ``MarginContainer`` by code, you should use the following examples:
::
.. tabs::
.. code-tab:: gdscript
# This code sample assumes the current script is extending MarginContainer.
var margin_value = 100
set("custom_constants/margin_top", margin_value)
set("custom_constants/margin_left", margin_value)
set("custom_constants/margin_bottom", margin_value)
set("custom_constants/margin_right", margin_value)
add_theme_constant_override("margin_top", margin_value)
add_theme_constant_override("margin_left", margin_value)
add_theme_constant_override("margin_bottom", margin_value)
add_theme_constant_override("margin_right", margin_value)
.. code-tab:: csharp
// This code sample assumes the current script is extending MarginContainer.
int marginValue = 100;
AddThemeConstantOverride("margin_top", marginValue);
AddThemeConstantOverride("margin_left", marginValue);
AddThemeConstantOverride("margin_bottom", marginValue);
AddThemeConstantOverride("margin_right", marginValue);
Theme Properties
----------------
+-----------------------+---------------+---+
| :ref:`int<class_int>` | margin_bottom | 0 |
+-----------------------+---------------+---+
| :ref:`int<class_int>` | margin_left | 0 |
+-----------------------+---------------+---+
| :ref:`int<class_int>` | margin_right | 0 |
+-----------------------+---------------+---+
| :ref:`int<class_int>` | margin_top | 0 |
+-----------------------+---------------+---+
+-----------------------+--------------------------------------------------------------------------+-------+
| :ref:`int<class_int>` | :ref:`margin_bottom<class_MarginContainer_theme_constant_margin_bottom>` | ``0`` |
+-----------------------+--------------------------------------------------------------------------+-------+
| :ref:`int<class_int>` | :ref:`margin_left<class_MarginContainer_theme_constant_margin_left>` | ``0`` |
+-----------------------+--------------------------------------------------------------------------+-------+
| :ref:`int<class_int>` | :ref:`margin_right<class_MarginContainer_theme_constant_margin_right>` | ``0`` |
+-----------------------+--------------------------------------------------------------------------+-------+
| :ref:`int<class_int>` | :ref:`margin_top<class_MarginContainer_theme_constant_margin_top>` | ``0`` |
+-----------------------+--------------------------------------------------------------------------+-------+
Theme Property Descriptions
---------------------------
.. _class_MarginContainer_theme_constant_margin_bottom:
- :ref:`int<class_int>` **margin_bottom**
+-----------+-------+
| *Default* | ``0`` |
+-----------+-------+
All direct children of ``MarginContainer`` will have a bottom margin of ``margin_bottom`` pixels.
----
.. _class_MarginContainer_theme_constant_margin_left:
- :ref:`int<class_int>` **margin_left**
+-----------+-------+
| *Default* | ``0`` |
+-----------+-------+
All direct children of ``MarginContainer`` will have a left margin of ``margin_left`` pixels.
----
.. _class_MarginContainer_theme_constant_margin_right:
- :ref:`int<class_int>` **margin_right**
+-----------+-------+
| *Default* | ``0`` |
+-----------+-------+
All direct children of ``MarginContainer`` will have a right margin of ``margin_right`` pixels.
----
.. _class_MarginContainer_theme_constant_margin_top:
- :ref:`int<class_int>` **margin_top**
+-----------+-------+
| *Default* | ``0`` |
+-----------+-------+
All direct children of ``MarginContainer`` will have a top margin of ``margin_top`` pixels.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`