Skip to content

Commit

Permalink
Improve margin for InfoBox title
Browse files Browse the repository at this point in the history
  • Loading branch information
Grimmys committed Apr 4, 2024
1 parent 8130de7 commit 76833f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pygamepopup/components/info_box.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Defines InfoBox class, an helper to draw any kind of popup (menu or informative message).
Defines InfoBox class, a helper to draw any kind of popup (menu or informative message).
"""

from __future__ import annotations
Expand Down Expand Up @@ -66,7 +66,7 @@ class InfoBox:
element_linked (pygame.Rect): the pygame Rect of the element linked to this infoBox if there is one
has_close_button (bool): whether the infoBox has a close button or not
title_color (pygame.Color): the color of the title
element_grid (list[list[BoxElement]): the grid containing the components that should be rendered by the infoBox
element_grid (list[list[BoxElement]]): the grid containing the components that should be rendered by the infoBox
buttons (Sequence[Button]): the sequence of buttons of the infoBox, including the close button if present
sprite (pygame.Surface): the pygame Surface corresponding to the sprite of the infoBox
visible_on_background (bool): whether the popup is visible on background or not
Expand Down Expand Up @@ -168,7 +168,7 @@ def init_elements(self) -> list[_Row]:
self.title,
pygame.Vector2(0, 0),
_default_fonts["info_box_title"],
(20, 0, 20, 0),
(10, 0, 30, 0),
self.title_color,
)
self.__separator["vertical_position"] += title.get_height()
Expand Down Expand Up @@ -197,7 +197,7 @@ def __determine_height(self) -> int:
Returns:
int: the computed height.
"""
# Margin to be add at begin and at end
# Margin to be added at begin and at end
height: int = MARGIN_BOX * 2
self.__separator["height"] -= height
self.__separator["vertical_position"] += height
Expand Down

0 comments on commit 76833f5

Please sign in to comment.