Skip to content

Commit 1401d46

Browse files
committed
Improve docs
1 parent 77018a9 commit 1401d46

File tree

10 files changed

+62
-52
lines changed

10 files changed

+62
-52
lines changed

docs/_source/add_sounds.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ can be customized by setting a sound file to several sounds defined by a type.
2424
2525
Sound types are the following:
2626

27-
======================================================== =============================
27+
======================================================== =========================
2828
Type Description
29-
======================================================== =============================
29+
======================================================== =========================
3030
:py:data:`pygame_menu.sound.SOUND_TYPE_CLICK_MOUSE` Mouse click
3131
:py:data:`pygame_menu.sound.SOUND_TYPE_CLOSE_MENU` A menu is closed
3232
:py:data:`pygame_menu.sound.SOUND_TYPE_ERROR` Generic error
@@ -36,7 +36,7 @@ Type Description
3636
:py:data:`pygame_menu.sound.SOUND_TYPE_KEY_DELETION` User deletes with a key
3737
:py:data:`pygame_menu.sound.SOUND_TYPE_OPEN_MENU` A menu is opened
3838
:py:data:`pygame_menu.sound.SOUND_TYPE_WIDGET_SELECTION` A widget is selected
39-
======================================================== =============================
39+
======================================================== =========================
4040

4141
.. autoclass:: Sound
4242
:members:

docs/_source/add_widgets.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Add a button
1515
A button is a text that fire action when the user trigger it. An action is linked
1616
to a button by defining the ``action`` parameter with one of the three values:
1717

18-
- a :py:class:`pygame_menu.menu.Menu`, in this case, it will be displayed
19-
when the button is triggered.
18+
- a :py:class:`pygame_menu.menu.Menu`, in this case, it will be displayed when
19+
the button is triggered.
2020
- a python callable object (a function, a method, a class, ...) that will be
2121
called with the given arguments.
2222
- a specific event of :py:mod:`pygame_menu`. The possible events are the

docs/_source/advanced_selection.rst

+22-13
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
:orphan:
33

4-
================
5-
Widget Selection
6-
================
4+
========================
5+
Widget selection effects
6+
========================
77

8-
Selection Effect
8+
Core Class
99
----------------
1010

1111
.. module:: pygame_menu.widgets.core.selection
@@ -14,8 +14,8 @@ Selection Effect
1414
:members:
1515

1616

17-
Highlight Selection Effect
18-
--------------------------
17+
Highlight Selection
18+
-------------------
1919

2020
.. module:: pygame_menu.widgets.selection.highlight
2121

@@ -24,8 +24,8 @@ Highlight Selection Effect
2424
:show-inheritance:
2525

2626

27-
Left Arrow Selection Effect
28-
---------------------------
27+
Left Arrow Selection
28+
--------------------
2929

3030
.. module:: pygame_menu.widgets.selection.left_arrow
3131

@@ -34,8 +34,8 @@ Left Arrow Selection Effect
3434
:show-inheritance:
3535

3636

37-
None Selection Effect
38-
---------------------
37+
None Selection
38+
--------------
3939

4040
.. module:: pygame_menu.widgets.selection.none
4141

@@ -44,12 +44,21 @@ None Selection Effect
4444
:show-inheritance:
4545

4646

47-
Right Arrow Selection Effect
48-
----------------------------
47+
Right Arrow Selection
48+
---------------------
4949

5050
.. module:: pygame_menu.widgets.selection.right_arrow
5151

5252
.. autoclass:: pygame_menu.widgets.RightArrowSelection
5353
:members:
5454
:show-inheritance:
55-
55+
56+
57+
Simple Selection
58+
----------------
59+
60+
.. module:: pygame_menu.widgets.selection.simple
61+
62+
.. autoclass:: pygame_menu.widgets.SimpleSelection
63+
:members:
64+
:show-inheritance:

docs/_source/themes.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ Alignment
7070

7171
The alignment (str) can take one of the three following values:
7272

73-
============================================== ========================
73+
============================================== ==================
7474
Alignment Description
75-
============================================== ========================
75+
============================================== ==================
7676
:py:data:`pygame_menu.locals.ALIGN_LEFT` Left alignment
7777
:py:data:`pygame_menu.locals.ALIGN_CENTER` Center alignment
7878
:py:data:`pygame_menu.locals.ALIGN_RIGHT` Right alignment
79-
============================================== ========================
79+
============================================== ==================
8080

8181

8282
Background Color/Images
@@ -106,16 +106,16 @@ Images needs a Path (file location on disk), a drawing mode, and an optional off
106106
)
107107
mytheme.background_color = myimage
108108
109-
===================================================== =========================================
109+
===================================================== ======================================
110110
Image drawing modes Description
111-
===================================================== =========================================
111+
===================================================== ======================================
112112
:py:data:`pygame_menu.baseimage.IMAGE_MODE_CENTER` Centers the image in the surface
113113
:py:data:`pygame_menu.baseimage.IMAGE_MODE_FILL` Fill the image on the surface
114114
:py:data:`pygame_menu.baseimage.IMAGE_MODE_REPEAT_X` Repeat the image on x axis
115115
:py:data:`pygame_menu.baseimage.IMAGE_MODE_REPEAT_XY` Repeat the image on x and y axis
116116
:py:data:`pygame_menu.baseimage.IMAGE_MODE_REPEAT_Y` Repeat the image on y axis
117117
:py:data:`pygame_menu.baseimage.IMAGE_MODE_SIMPLE` Write the image on top-left location
118-
===================================================== =========================================
118+
===================================================== ======================================
119119

120120
Currently, :py:class:`Theme` class only supports images for :py:attr:`background_color`
121121
and :py:attr:`widget_background_color`. Also, only `IMAGE_MODE_FILL` drawing mode
@@ -185,9 +185,9 @@ Positioning
185185

186186
Several possible positions are accepted by some configurations:
187187

188-
================================================= ========================
188+
================================================= =====================
189189
Position Description
190-
================================================= ========================
190+
================================================= =====================
191191
:py:data:`pygame_menu.locals.POSITION_EAST` East position
192192
:py:data:`pygame_menu.locals.POSITION_NORTH` North position
193193
:py:data:`pygame_menu.locals.POSITION_NORTHEAST` North/East position
@@ -196,7 +196,7 @@ Position Description
196196
:py:data:`pygame_menu.locals.POSITION_SOUTHEAST` South/East position
197197
:py:data:`pygame_menu.locals.POSITION_SOUTHWEST` South/West position
198198
:py:data:`pygame_menu.locals.POSITION_WEST` West position
199-
================================================= ========================
199+
================================================= =====================
200200

201201
Special positions used by Menu :py:class:`pygame_menu._scrollarea.ScrollArea`
202202
(all above are available):

docs/index.rst

+10-9
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,20 @@ This chapter define rules and advanced tips and tricks to develop extensions for
9494
- :ref:`Creating a selection effect <Create a selection effect>`
9595

9696
.. toctree::
97-
:maxdepth: 2
98-
:hidden:
99-
:caption: Advanced usage
97+
:maxdepth: 2
98+
:hidden:
99+
:caption: Advanced usage
100100

101-
_source/advanced
101+
_source/advanced
102+
_source/advanced_selection
102103

103104
.. toctree::
104-
:maxdepth: 2
105-
:hidden:
106-
:caption: Menu APIs
105+
:maxdepth: 2
106+
:hidden:
107+
:caption: Menu APIs
107108

108-
_source/baseimage
109-
_source/scrollarea.rst
109+
_source/baseimage
110+
_source/scrollarea.rst
110111

111112

112113
===========

pygame_menu/widgets/selection/arrow_selection.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ class ArrowSelection(Selection):
4747
Widget selection arrow class.
4848
Parent class for left and right arrow selection classes.
4949
50-
:param margin_left: Left margin
51-
:param margin_right: Right margin
52-
:param margin_top: Top margin
53-
:param margin_bottom: Bottom margin
50+
:param margin_left: Left margin (px)
51+
:param margin_right: Right margin (px)
52+
:param margin_top: Top margin (px)
53+
:param margin_bottom: Bottom margin (px)
5454
:param arrow_size: Size of arrow on x-axis and y-axis (width, height) in px
55-
:param arrow_vertical_offset: Vertical offset of the arrow
56-
:param blink_ms: Milliseconds between each blink, if ``0`` blinking is disabled
55+
:param arrow_vertical_offset: Vertical offset of the arrow (px)
56+
:param blink_ms: Milliseconds between each blink; if ``0`` blinking is disabled
5757
"""
5858
_arrow_vertical_offset: int
5959
_arrow_size: Tuple2IntType

pygame_menu/widgets/selection/highlight.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ class HighlightSelection(Selection):
4747
4848
Widget background color may not reach the entire selection area.
4949
50-
:param border_width: Border width of the highlight box
51-
:param margin_x: X margin of selected highlight box
52-
:param margin_y: Y margin of selected highlight box
50+
:param border_width: Border width of the highlight box (px)
51+
:param margin_x: X margin of selected highlight box (px)
52+
:param margin_y: Y margin of selected highlight box (px)
5353
"""
5454
_border_width: int
5555

pygame_menu/widgets/selection/left_arrow.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ class LeftArrowSelection(ArrowSelection):
4545
Creates an arrow to the left of the selected Menu item.
4646
4747
:param arrow_size: Size of arrow on x-axis and y-axis (width, height) in px
48-
:param arrow_right_margin: Distance from the arrow to the widget
49-
:param arrow_vertical_offset: Vertical offset of the arrow
50-
:param blink_ms: Milliseconds between each blink, if ``0`` blinking is disabled
48+
:param arrow_right_margin: Distance from the arrow to the widget (px)
49+
:param arrow_vertical_offset: Vertical offset of the arrow (px)
50+
:param blink_ms: Milliseconds between each blink; if ``0`` blinking is disabled
5151
"""
5252
_arrow_right_margin: int
5353

pygame_menu/widgets/selection/right_arrow.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ class RightArrowSelection(ArrowSelection):
4545
selected Menu item.
4646
4747
:param arrow_size: Size of arrow on x-axis and y-axis (width, height) in px
48-
:param arrow_left_margin: Distance from the arrow to the widget
49-
:param arrow_vertical_offset: Vertical offset of the arrow
50-
:param blink_ms: Milliseconds between each blink, if ``0`` blinking is disabled
48+
:param arrow_left_margin: Distance from the arrow to the widget (px)
49+
:param arrow_vertical_offset: Vertical offset of the arrow (px)
50+
:param blink_ms: Milliseconds between each blink; if ``0`` blinking is disabled
5151
"""
5252
_arrow_left_margin: int
5353

pygame_menu/widgets/widget/scrollbar.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class ScrollBar(Widget):
6969
:param values_range: Min and max values
7070
:param scrollbar_id: Bar identifier
7171
:param orientation: Bar orientation (horizontal or vertical). See :py:mod:`pygame_menu.locals`
72-
:param slider_pad: Space between slider and page control
72+
:param slider_pad: Space between slider and page control (px)
7373
:param slider_color: Color of the slider
7474
:param page_ctrl_thick: Page control thickness
7575
:param page_ctrl_color: Page control color

0 commit comments

Comments
 (0)