From c474e518148b816e44990420d2e324fcda67cf68 Mon Sep 17 00:00:00 2001 From: proneon267 <45512885+proneon267@users.noreply.github.com> Date: Sat, 18 Feb 2023 00:32:25 -0500 Subject: [PATCH 1/3] Update pack.rst Added a note mentioning that the values should be passed as strings. Added missing ``font_style`` description and missing value of ``visibility``. --- docs/reference/style/pack.rst | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/reference/style/pack.rst b/docs/reference/style/pack.rst index 09ec6bf251..3e2d4cfd07 100644 --- a/docs/reference/style/pack.rst +++ b/docs/reference/style/pack.rst @@ -11,6 +11,9 @@ properties exist to control color, text alignment and so on. It is similar in some ways to the CSS Flexbox algorithm; but dramatically simplified, as there is no allowance for overflowing boxes. +**NOTE:** The value for different Pack style properties should be passed as string. For example: +``style=Pack(direction="column")`` + Pack style properties ~~~~~~~~~~~~~~~~~~~~~ @@ -30,7 +33,7 @@ visible. ``visibility`` -------------- -**Values:** ``visible`` | ``none`` +**Values:** ``hidden`` | ``visible`` | ``none`` **Initial value:** ``visible`` @@ -183,7 +186,7 @@ Defines the natural direction of horizontal content. ``font_family`` --------------- -**Values:** ``system`` | ``serif``| ``sans-serif`` | ``cursive`` | ``fantasy`` | ``monospace`` | ```` +**Values:** ``system`` | ``serif`` | ``sans-serif`` | ``cursive`` | ``fantasy`` | ``monospace`` | ```` **Initial value:** ``system`` @@ -196,6 +199,15 @@ A value of ``serif``, ``sans-serif``, ``cursive``, ``fantasy``, or ``monospace`` Otherwise, any font name can be specified. If the font name cannot be resolved, the system font will be used. +``font_style`` +---------------- + +**Values:** ``normal`` | ``italic`` | ``oblique`` + +**Initial value:** ``normal`` + +The style of the font to be used. + ``font_variant`` ---------------- From de834a8bbc612d447327de4f3b73fa24dd7d9a50 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Mon, 20 Feb 2023 06:19:41 +0800 Subject: [PATCH 2/3] Add changenote. --- changes/1786.doc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/1786.doc.rst diff --git a/changes/1786.doc.rst b/changes/1786.doc.rst new file mode 100644 index 0000000000..5d2d9e6a1b --- /dev/null +++ b/changes/1786.doc.rst @@ -0,0 +1 @@ +Some missing settings and constant values were added to the documentation of Pack. From 542a7ce45fc0b7bfb378ca6b753e0adf9a29169b Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Mon, 20 Feb 2023 06:20:14 +0800 Subject: [PATCH 3/3] Clarified and improved markup for note about constants. --- docs/reference/style/pack.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/reference/style/pack.rst b/docs/reference/style/pack.rst index 3e2d4cfd07..fb697ff09d 100644 --- a/docs/reference/style/pack.rst +++ b/docs/reference/style/pack.rst @@ -11,8 +11,13 @@ properties exist to control color, text alignment and so on. It is similar in some ways to the CSS Flexbox algorithm; but dramatically simplified, as there is no allowance for overflowing boxes. -**NOTE:** The value for different Pack style properties should be passed as string. For example: -``style=Pack(direction="column")`` +.. admonition:: + + The string values defined here are the string literals that the Pack + algorithm accepts. These values are also pre-defined as Python constants in + the ``toga.style.pack`` module with the same name; however, following Python + style, the constants use upper case. For example, the Python constant + ``toga.style.pack.COLUMN`` evaluates as the string literal ``"column"``. Pack style properties ~~~~~~~~~~~~~~~~~~~~~