-
Notifications
You must be signed in to change notification settings - Fork 1
Add Modern UI and Cross-Platform Mobile Support #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes the Minesweeper UI with a dark flat theme and adds cross-platform mobile support by introducing dynamic configurations and rendering logic.
- Updated color palettes, tile/border radii, fonts, and button styles for a contemporary look.
- Added mobile detection and platform-adaptive constants to adjust grid dimensions, padding, and rendering.
- Refactored drawing methods in
tile.py,grid.py, andgame.pyto use new constants and responsive layouts; simplifiedmain.pyargument parsing.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| minesweeper/tile.py | Replaced image blits with vector drawing for tiles and flags. |
| minesweeper/grid.py | Switched to modern palette and minimal spacing in draw_grid. |
| minesweeper/game.py | Introduced IS_MOBILE detection, adaptive constants, refactored layouts and UI methods. |
| main.py | Simplified CLI parsing and added --mobile flag support. |
Comments suppressed due to low confidence (3)
minesweeper/game.py:23
- The code references
sys.argvfor mobile detection butsysis not imported in this file, which will cause a NameError. Addimport sysat the top.
'--mobile' in sys.argv or
main.py:8
- The code uses
argparse(and latersys) in this file without importing these modules, which will cause NameErrors. Addimport argparseandimport sysat the top ofmain.py.
parser = argparse.ArgumentParser(description='Run Minesweeper game')
minesweeper/game.py:564
- The updated
get_tile_at_posno longer accounts for the horizontal grid offset, but callers still expect positioning to considerGRID_X_OFFSET. This will miscompute columns when the grid is centered. Reintroduce offset handling or adjust callers accordingly.
def get_tile_at_pos(mouse_x: int, mouse_y: int, tile_size: int, buffer: int) -> tuple[int, int]:
🎨 Modern UI Redesign
📱 Cross-Platform Mobile Support
⚙️ Technical Improvements