Skip to content

Commit

Permalink
Enhance docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ppizarror committed Dec 21, 2024
1 parent d72d7cd commit 00f64c2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ insert_final_newline = false
indent_size = 4
indent_style = space

[{*.json, *.yml}]
[{*.json,*.yml}]
indent_size = 2
indent_style = space
2 changes: 1 addition & 1 deletion docs/add_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def make_menu(
# noinspection PyMissingTypeHints,PyMissingOrEmptyDocstring
def change_background_color(selected_value, color, **kwargs):
from random import randrange
value_tuple, index = selected_value
value_tuple, _ = selected_value
print('Change widget color to', value_tuple[0]) # selected_value format ('Color', surface, color)
if color == (-1, -1, -1): # Generate a random color
color = (randrange(0, 255), randrange(0, 255), randrange(0, 255))
Expand Down
4 changes: 2 additions & 2 deletions pygame_menu/_scrollarea.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ class ScrollArea(Base):
_menubar: 'pygame_menu.widgets.MenuBar'
_parent_scrollarea: 'ScrollArea'
_rect: 'pygame.Rect'
_scrollbar_positions: Tuple[str, ...]
_scrollbar_positions: Union[str, Tuple[str, ...]]
_scrollbars: List['ScrollBar']
_scrollbars_props: Tuple[Any, ...]
_translate: Tuple2IntType
_view_rect: 'pygame.Rect'
_world: 'pygame.Surface'
_world: Optional['pygame.Surface']

def __init__(
self,
Expand Down
1 change: 1 addition & 0 deletions test/test_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ def test_get_selected_widget(self) -> None:
self.assertIsNone(menu.get_selected_widget())

# Destroy index
# noinspection PyTypeChecker
menu._index = '0'
self.assertIsNone(menu.get_selected_widget())
self.assertEqual(menu._index, 0)
Expand Down
1 change: 1 addition & 0 deletions test/test_widget_dropselect.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ def remove_selection_item(select: 'pygame_menu.widgets.DropSelect'):
# Ignore buttons if not active
self.assertFalse(sel.update(PygameEventUtils.key(pygame_menu.controls.KEY_MOVE_UP, keydown=True)))

# noinspection PyTypeChecker
def test_dropselect_multiple(self) -> None:
"""
Test dropselect multiple widget.
Expand Down
1 change: 1 addition & 0 deletions test/test_widget_textinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ def test_unicode(self) -> None:
textinput._input_type = 'other'
self.assertTrue(textinput._check_input_type('-'))
self.assertFalse(textinput._check_input_type('x'))
# noinspection PyTypeChecker
textinput._maxwidth_update = None
self.assertIsNone(textinput._update_maxlimit_renderbox())

Expand Down

0 comments on commit 00f64c2

Please sign in to comment.