Skip to content

Commit

Permalink
Merge branch 'main' into 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MyreMylar authored Oct 11, 2023
2 parents fdb2a97 + 19819bc commit d9411f8
Show file tree
Hide file tree
Showing 86 changed files with 1,114 additions and 471 deletions.
33 changes: 15 additions & 18 deletions .github/workflows/run_tests_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
pygame-ce-version: ['2.1.4', '2.2.1']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
pygame-ce-version: ['2.3.2']
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4.1.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4.7.1
with:
python-version: ${{ matrix.python-version }}
pygame-ce-version: ${{ matrix.pygame-ce-version }}
Expand All @@ -25,7 +25,6 @@ jobs:
python -m pip install pytest
python -m pip install pytest-benchmark
python -m pip install pytest-cov
python -m pip install codecov
python -m pip install -q pygame-ce==${{ matrix.pygame-ce-version }}
python -m pip install . -U
sudo apt-get install xvfb
Expand All @@ -38,7 +37,7 @@ jobs:
run: |
xvfb-run pytest --cov-report=xml --cov=pygame_gui tests/
- name: Upload to Code Cov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} #required

Expand All @@ -48,12 +47,12 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [ '3.11' ]
pygame-ce-version: [ '2.1.4', '2.2.1' ]
python-version: [ '3.11','3.12' ]
pygame-ce-version: [ '2.3.2' ]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4.1.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4.7.1
with:
python-version: ${{ matrix.python-version }}
pygame-ce-version: ${{ matrix.pygame-ce-version }}
Expand All @@ -65,7 +64,6 @@ jobs:
python -m pip install pytest
python -m pip install pytest-benchmark
python -m pip install pytest-cov
python -m pip install codecov
python -m pip install -q pygame-ce==${{ matrix.pygame-ce-version }}
python -m pip install . -U
- name: Test with pytest
Expand All @@ -75,7 +73,7 @@ jobs:
run: |
pytest --cov-report=xml --cov=pygame_gui tests/
- name: Upload to Code Cov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} #required

Expand All @@ -85,12 +83,12 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [ '3.11' ]
pygame-ce-version: [ '2.1.4', '2.2.1' ]
python-version: [ '3.11', '3.12' ]
pygame-ce-version: [ '2.3.2' ]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4.1.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4.7.1
with:
python-version: ${{ matrix.python-version }}
pygame-ce-version: ${{ matrix.pygame-ce-version }}
Expand All @@ -102,7 +100,6 @@ jobs:
python -m pip install pytest
python -m pip install pytest-benchmark
python -m pip install pytest-cov
python -m pip install codecov
python -m pip install -q pygame-ce==${{ matrix.pygame-ce-version }}
python -m pip install . -U
- name: Test with pytest
Expand All @@ -112,6 +109,6 @@ jobs:
run: |
pytest --cov-report=xml --cov=pygame_gui tests/
- name: Upload to Code Cov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} #required
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ A GUI system for pygame CE.
- [Examples](https://github.com/MyreMylar/pygame_gui_examples)
- [PyPi](https://pypi.org/project/pygame-gui/)

[![pypi](https://badge.fury.io/py/pygame-gui.svg)](https://pypi.python.org/pypi/pygame-gui) [![Documentation Status](https://readthedocs.org/projects/pygame-gui/badge/?version=latest)](https://pygame-gui.readthedocs.io/en/latest/?badge=latest) [![Python 3.7+](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/release/python-360/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Master](https://travis-ci.com/MyreMylar/pygame_gui.svg?branch=master)](https://travis-ci.com/MyreMylar/pygame_gui) [![codecov](https://codecov.io/gh/MyreMylar/pygame_gui/branch/main/graph/badge.svg?token=zZhkvhgTki)](https://codecov.io/gh/MyreMylar/pygame_gui) [![Downloads](https://pepy.tech/badge/pygame-gui)](https://pepy.tech/project/pygame-gui)
[![pypi](https://badge.fury.io/py/pygame-gui.svg)](https://pypi.python.org/pypi/pygame-gui) [![Documentation Status](https://readthedocs.org/projects/pygame-gui/badge/?version=latest)](https://pygame-gui.readthedocs.io/en/latest/?badge=latest) [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/release/python-380/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Master](https://travis-ci.com/MyreMylar/pygame_gui.svg?branch=master)](https://travis-ci.com/MyreMylar/pygame_gui) [![codecov](https://codecov.io/gh/MyreMylar/pygame_gui/branch/main/graph/badge.svg?token=zZhkvhgTki)](https://codecov.io/gh/MyreMylar/pygame_gui) [![Downloads](https://pepy.tech/badge/pygame-gui)](https://pepy.tech/project/pygame-gui)
## Requirements

- Python 3.7+
- Python 3.8+
- Pygame Community Edition 2.1.4+
- python-i18n (does localization to different languages)

Expand Down
1 change: 1 addition & 0 deletions docs/source/localization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Right now the list of languages support by default by Pygame GUI elements and wi
- Russian
- Simplified Chinese
- Polish
- Vietnamese

Though many of the translations may be imperfect as they were largely not handled by native speakers (yet). If you
would like to improve an existing translation or add a new one the current default translations are
Expand Down
5 changes: 4 additions & 1 deletion docs/source/theme_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,10 @@ of our UI theme.
Prototype theme blocks must be defined higher in the theme file than where they are used, otherwise they won't exist to
be imported.

Here's a quick example:
If you are using multiple locale specifiers in font blocks, you will need to specify these in every font block in your
prototype hierarchy so that the theme loading can determine which locale's font to apply the theming to.

Here's a quick example of using a simple prototype:

.. code-block:: json
:caption: theme.json
Expand Down
4 changes: 2 additions & 2 deletions docs/source/theme_reference/theme_button.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Font
block has these parameters:

- "**name**" - Necessary to make a valid block. This is the name that this font goes by in the UI, if this is a new font then subsequent font instances with different styles or sizes should use the same name.
- "**locale**" - Optional parameter to set this font as belonging to a particular locale only. See the :ref:`localization` guide.
- "**locale**" - Optional parameter to set this font as belonging to a particular locale only. See the :ref:`localization` guide. You will need to keep repeating the locale specifier if using prototypes to make a hierarchy.
- "**size**" - Necessary to make a valid block. This is the point size of the font to use on the button.
- "**bold**" - Optional parameter. Set it to "1" to make this font bold.
- "**italic**" - Optional parameter. Set it to "1" to make this font italic.
Expand Down Expand Up @@ -125,7 +125,7 @@ Misc
- "**shape_corner_radius**" - Only used if our shape is 'rounded_rectangle'. It sets the radius used for the rounded corners.
- "**border_width**" - the width in pixels of the border around the button. Defaults to 1.
- "**shadow_width**" - the width in pixels of the shadow behind the button. Defaults to 2.
- "**tool_tip_delay**" - time in seconds before a the buttons tool sip (if it has one) will appear. Default is "1.0".
- "**tool_tip_delay**" - time in seconds before the button's tool tip (if it has one) will appear. Default is "1.0".
- "**text_horiz_alignment**" - Set to "left", "right" or "center". Controls the horizontal placement of the button text, if this button has any text. Default is "center".
- "**text_vert_alignment**" - Set to "top", "bottom or "center". Controls the vertical placement of the button text, if this button has any text. Default is "center".
- "**text_horiz_alignment_padding**" - If horizontal alignment is set to 'left' or 'right' this value will control the buffer between the edge of the button and where we start placing the text. Default is "1".
Expand Down
3 changes: 2 additions & 1 deletion docs/source/theme_reference/theme_colour_picker_dialog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
UIColourPickerDialog Theming Parameters
=======================================

:class:`UIColourPickerDialog <pygame_gui.windows.UIColourPickerDialog>` is a UIWindow with the object id of '#colour_picker_dialog'.
:class:`UIColourPickerDialog <pygame_gui.windows.UIColourPickerDialog>` is a UIWindow with the element id of
'colour_picker_dialog' and the default object id of '#colour_picker_dialog'.

.. figure:: ../_static/colour_picker_static_image.png

Expand Down
9 changes: 5 additions & 4 deletions docs/source/theme_reference/theme_confirmation_dialog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
UIConfirmationDialog Theming Parameters
=======================================

:class:`UIConfirmationDialog <pygame_gui.windows.UIConfirmationDialog>` is a UIWindow with the object id of '#confirmation_dialog'.
:class:`UIConfirmationDialog <pygame_gui.windows.UIConfirmationDialog>` is a UIWindow with the element id of
'confirmation_dialog' and a default object id of '#confirmation_dialog'.

.. figure:: ../_static/confirmation_dialog_static_image.png

Expand All @@ -23,11 +24,11 @@ As well as the sub-elements of the UIWindow (title bar and close button) which y

UIButtons:

- '#confirmation_dialog.#confirm_button'
- '#confirmation_dialog.#cancel_button'
- 'confirmation_dialog.#confirm_button'
- 'confirmation_dialog.#cancel_button'

UITextBox:

- '#confirmation_dialog.text_box'
- 'confirmation_dialog.text_box'

You can find out more about theming buttons here: :ref:`theme-button` and text boxes here: :ref:`theme-text-box`.
1 change: 1 addition & 0 deletions docs/source/theme_reference/theme_drop_down_menu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Misc
- "**border_width**" - the width in pixels of the border around the drop down menu. Defaults to "1".
- "**shadow_width**" - the width in pixels of the shadow behind the button. Defaults to "1".
- "**open_button_width**" - the width of the open/close button on the right hand side of the drop down. Defaults to "20" (pixels). Set it to "0" to remove the open/close button.
- "**tool_tip_delay**" - time in seconds before the button's tool tip (if it has one) will appear. Default is "1.0".

Sub-elements
--------------
Expand Down
19 changes: 10 additions & 9 deletions docs/source/theme_reference/theme_file_dialog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
UIFileDialog Theming Parameters
===============================

:class:`UIFileDialog <pygame_gui.windows.UIFileDialog>` is a UIWindow with the object id of '#file_dialog'.
:class:`UIFileDialog <pygame_gui.windows.UIFileDialog>` is a UIWindow with the element id of 'file_dialog' and a default
object id of '#file_dialog'.


.. figure:: ../_static/file_dialog_static_image.png
Expand All @@ -25,20 +26,20 @@ As well as the sub-elements of the UIWindow (title bar and close button) which y

UIButtons:

- '#file_dialog.#ok_button'
- '#file_dialog.#cancel_button'
- '#file_dialog.#home_icon_button'
- '#file_dialog.#delete_icon_button'
- '#file_dialog.#parent_icon_button'
- '#file_dialog.#refresh_icon_button'
- 'file_dialog.#ok_button'
- 'file_dialog.#cancel_button'
- 'file_dialog.#home_icon_button'
- 'file_dialog.#delete_icon_button'
- 'file_dialog.#parent_icon_button'
- 'file_dialog.#refresh_icon_button'

UITextEntryLine:

- '#file_dialog.#file_path_text_line'
- 'file_dialog.#file_path_text_line'

UISelectionList:

- '#file_dialog.#file_display_list'
- 'file_dialog.#file_display_list'

You can find out more about theming buttons here: :ref:`theme-button`, text entry lines here: :ref:`theme-text-entry-line`
and selection lists here: :ref:`theme-selection-list`.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Misc
- "**border_width**" - the width in pixels of the border around the bar. Defaults to 1.
- "**shadow_width**" - the width in pixels of the shadow behind the bar. Defaults to 1.
- "**enable_arrow_buttons**" - Enables or disables the arrow buttons for the scroll bar. "1" is enabled, "0" is disabled. Defaults to "1".
- "**tool_tip_delay**" - time in seconds before the button's tool tip (if it has one) will appear. Default is "1.0".

Sub-elements
--------------
Expand Down
1 change: 1 addition & 0 deletions docs/source/theme_reference/theme_horizontal_slider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Misc
- "**shadow_width**" - the width in pixels of the shadow behind the slider. Defaults to 1.
- "**enable_arrow_buttons**" - Enables or disables the arrow buttons for the slider. "1" is enabled, "0" is disabled. Defaults to "1".
- "**sliding_button_width**" - Sets the width of the sliding button. Defaults to "20".
- "**tool_tip_delay**" - time in seconds before the button's tool tip (if it has one) will appear. Default is "1.0".

Sub-elements
--------------
Expand Down
2 changes: 2 additions & 0 deletions docs/source/theme_reference/theme_label.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Font
:class:`UILabel <pygame_gui.elements.UILabel>` accepts a font specified in the theme via a 'font' block. A 'font' block has these parameters:

- "**name**" - Necessary to make a valid block. This is the name that this font goes by in the UI, if this is a new font then subsequent font instances with different styles or sizes should use the same name.
- "**locale**" - Optional parameter to set this font as belonging to a particular locale only. See the :ref:`localization` guide. You will need to keep repeating the locale specifier if using prototypes to make a hierarchy.
- "**size**" - Necessary to make a valid block. This is the point size of the font to use on the label.
- "**bold**" - Optional parameter. Set it to "1" to make this font bold.
- "**italic**" - Optional parameter. Set it to "1" to make this font italic.
Expand Down Expand Up @@ -67,6 +68,7 @@ Misc
- "**text_vert_alignment**" - Set to "top", "bottom or "center". Controls the vertical placement of the label text. Default is "center".
- "**text_horiz_alignment_padding**" - If horizontal alignment is set to 'left' or 'right' this value will control the buffer between the edge of the label rectangle and where we start placing the text. Default is "0".
- "**text_vert_alignment_padding**" - If vertical alignment is set to 'top' or 'bottom' this value will control the buffer between the edge of the label rectangle and where we start placing the text. Default is "0".
- "**tool_tip_delay**" - time in seconds before the button's tool tip (if it has one) will appear. Default is "1.0".

Example
-------
Expand Down
7 changes: 4 additions & 3 deletions docs/source/theme_reference/theme_message_window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
UIMessageWindow Theming Parameters
=======================================

:class:`UIMessageWindow <pygame_gui.windows.UIMessageWindow>` is a UIWindow with the object id of '#message_window'.
:class:`UIMessageWindow <pygame_gui.windows.UIMessageWindow>` is a UIWindow with the element id of 'message_window' and
a default object id of '#message_window'.

.. figure:: ../_static/message_window_static_image.png

Expand All @@ -23,10 +24,10 @@ As well as the sub-elements of the UIWindow (title bar and close button) which y

UIButtons:

- '#message_window.#dismiss_button'
- 'message_window.#dismiss_button'

UITextBox:

- '#message_window.text_box'
- 'message_window.text_box'

You can find out more about theming buttons here: :ref:`theme-button` and text boxes here: :ref:`theme-text-box`.
1 change: 1 addition & 0 deletions docs/source/theme_reference/theme_panel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Misc
- "**shape_corner_radius**" - Only used if our shape is 'rounded_rectangle'. It sets the radius used for the rounded corners. Defaults to "2".
- "**border_width**" - The width of the border around the element in pixels. Defaults to "1".
- "**shadow_width**" - The width of the shadow around the element in pixels. Defaults to "2".
- "**tool_tip_delay**" - time in seconds before the button's tool tip (if it has one) will appear. Default is "1.0".


Example
Expand Down
2 changes: 2 additions & 0 deletions docs/source/theme_reference/theme_progress_bar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Misc
- "**shape_corner_radius**" - Only used if our shape is 'rounded_rectangle'. It sets the radius used for the rounded corners.
- "**border_width**" - the width in pixels of the border around the bar. Defaults to 1.
- "**shadow_width**" - the width in pixels of the shadow behind the bar. Defaults to 1.
- "**tool_tip_delay**" - time in seconds before the button's tool tip (if it has one) will appear. Default is "1.0".


Font
Expand All @@ -46,6 +47,7 @@ Font
:class:`UIProgressBar <pygame_gui.elements.UIProgressBar>` accepts a font specified in the theme via a 'font' block. A 'font' block has these parameters:

- "**name**" - Necessary to make a valid block. This is the name that this font goes by in the UI, if this is a new font then subsequent font instances with different styles or sizes should use the same name.
- "**locale**" - Optional parameter to set this font as belonging to a particular locale only. See the :ref:`localization` guide. You will need to keep repeating the locale specifier if using prototypes to make a hierarchy.
- "**size**" - Necessary to make a valid block. This is the point size of the font to use on the health bar.
- "**bold**" - Optional parameter. Set it to "1" to make this font bold.
- "**italic**" - Optional parameter. Set it to "1" to make this font italic.
Expand Down
2 changes: 2 additions & 0 deletions docs/source/theme_reference/theme_screen_space_health_bar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Misc
- "**shape_corner_radius**" - Only used if our shape is 'rounded_rectangle'. It sets the radius used for the rounded corners.
- "**border_width**" - the width in pixels of the border around the bar. Defaults to 1.
- "**shadow_width**" - the width in pixels of the shadow behind the bar. Defaults to 1.
- "**tool_tip_delay**" - time in seconds before the button's tool tip (if it has one) will appear. Default is "1.0".


Font
Expand All @@ -46,6 +47,7 @@ Font
:class:`UIScreenSpaceHealthBar <pygame_gui.elements.UIScreenSpaceHealthBar>` accepts a font specified in the theme via a 'font' block. A 'font' block has these parameters:

- "**name**" - Necessary to make a valid block. This is the name that this font goes by in the UI, if this is a new font then subsequent font instances with different styles or sizes should use the same name.
- "**locale**" - Optional parameter to set this font as belonging to a particular locale only. See the :ref:`localization` guide. You will need to keep repeating the locale specifier if using prototypes to make a hierarchy.
- "**size**" - Necessary to make a valid block. This is the point size of the font to use on the health bar.
- "**bold**" - Optional parameter. Set it to "1" to make this font bold.
- "**italic**" - Optional parameter. Set it to "1" to make this font italic.
Expand Down
1 change: 1 addition & 0 deletions docs/source/theme_reference/theme_selection_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Misc
- "**border_width**" - The width of the border around the element in pixels. Defaults to "1".
- "**shadow_width**" - The width of the shadow around the element in pixels. Defaults to "2".
- "**list_item_height**" - The pixel height of a the items in the list. Defaults to "20".
- "**tool_tip_delay**" - time in seconds before the button's tool tip (if it has one) will appear. Default is "1.0".

Sub-elements
--------------
Expand Down
1 change: 1 addition & 0 deletions docs/source/theme_reference/theme_status_bar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Misc
- "**follow_sprite_offset**" - The x,y offset values for when the bar follows a sprite. Defaults to "0,0".
- "**border_width**" - The width of the border around the health bar. Defaults to "1". Can be "0" to remove the border.
- "**shadow_width**" - The width of the border around the health bar. Defaults to "1". Can be "0" to remove the border.
- "**tool_tip_delay**" - time in seconds before the button's tool tip (if it has one) will appear. Default is "1.0".

Example
-------
Expand Down
1 change: 1 addition & 0 deletions docs/source/theme_reference/theme_text_box.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Misc
- "**text_horiz_alignment_padding**" - If horizontal alignment is set to 'left' or 'right' this value will control the buffer between the edge of the box padding and where we start placing the text. Default is "0". Using "padding" is better but these parameters are included for completeness.
- "**text_vert_alignment_padding**" - If vertical alignment is set to 'top' or 'bottom' this value will control the buffer between the edge of the box padding and where we start placing the text. Default is "0". Using "padding" is better but these parameters are included for completeness.
- "**line_spacing**" - Sets the spacing of lines of text. The default is 1.25.
- "**tool_tip_delay**" - time in seconds before the button's tool tip (if it has one) will appear. Default is "1.0".

Sub-elements
--------------
Expand Down
Loading

0 comments on commit d9411f8

Please sign in to comment.