Skip to content

fix: responsive pc box#304

Open
abr-Projects wants to merge 2 commits intoh0tp-ftw:mainfrom
abr-Projects:responsive-pc-box
Open

fix: responsive pc box#304
abr-Projects wants to merge 2 commits intoh0tp-ftw:mainfrom
abr-Projects:responsive-pc-box

Conversation

@abr-Projects
Copy link

@abr-Projects abr-Projects commented Feb 9, 2026

Resolves issue #302 #247

This pull request refactors the pokemon pc box ui to make the pokemon grid responsive. The main changes include separating the grid refresh logic from the overall gui construction, adding dynamic resizing for the grid, and debounced refreshes to optimize rendering during window resizing. refresh_pokemon_grid is also called whenever pokemon is added or evolved, to keep the pokemon grid in sync.

Changes:

  • Separated the pokemon grid rendering into a new refresh_pokemon_grid method, allowing the grid to be updated independently from the rest of the gui.
  • The grid now recalculates number of rows and columns based on the viewport size. It is handled by listening to the resize events and using a debounced timer QTimer to avoid excessive refreshes during window resizing.
  • Moved the pokemon grid into a scrollable container QScrollArea, for the handling of shrinking windows and ensuring that only fully visible slots are displayed.
  • Replaced full gui rebuilds on box change, with grid refresh.
  • Add refresh_pokemon_grid method calls to functions that manipulate the pokemon collection.
  • Cleaned up some redundant code

@abr-Projects abr-Projects marked this pull request as draft February 10, 2026 18:19
@abr-Projects abr-Projects changed the title fix: grid not adapting to viewport size fix: responsive pc box Feb 11, 2026
@abr-Projects abr-Projects marked this pull request as ready for review February 11, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant