@@ -70,16 +70,23 @@ def onCreate(self):
7070 self .SCREEN_HEIGHT = d .get_vertical_resolution ()
7171
7272 # Calculate scaling based on available space
73- available_height = self .SCREEN_HEIGHT - 75 # Leave space for controls
73+ available_height = self .SCREEN_HEIGHT - 40 # Leave space for top bar only
7474 max_cell_size = min (available_height // self .ROWS , (self .SCREEN_WIDTH - 20 ) // self .COLS )
7575 self .CELL_SIZE = max_cell_size
7676 self .PIECE_RADIUS = int (self .CELL_SIZE * 0.4 )
7777 self .BOARD_TOP = 35
7878
79- # Difficulty selector (top left)
79+ # Status label (top left)
80+ self .status_label = lv .label (self .screen )
81+ self .status_label .set_text ("Your turn!" )
82+ self .status_label .set_style_text_font (lv .font_montserrat_12 , 0 )
83+ self .status_label .set_style_text_color (lv .color_hex (0xFFFFFF ), 0 )
84+ self .status_label .set_pos (5 , 10 )
85+
86+ # Difficulty selector (top center)
8087 difficulty_cont = lv .obj (self .screen )
81- difficulty_cont .set_size (145 , 28 )
82- difficulty_cont .set_pos ( 5 , 3 )
88+ difficulty_cont .set_size (60 , 26 )
89+ difficulty_cont .align ( lv . ALIGN . TOP_MID , 0 , 5 )
8390 difficulty_cont .set_style_bg_color (lv .color_hex (0x2C3E50 ), 0 )
8491 difficulty_cont .set_style_border_width (1 , 0 )
8592 difficulty_cont .set_style_border_color (lv .color_hex (0xFFFFFF ), 0 )
@@ -88,17 +95,20 @@ def onCreate(self):
8895 difficulty_cont .add_event_cb (self .cycle_difficulty , lv .EVENT .CLICKED , None )
8996
9097 self .difficulty_label = lv .label (difficulty_cont )
91- self .difficulty_label .set_text ("Difficulty: Easy" )
98+ self .difficulty_label .set_text ("Easy" )
9299 self .difficulty_label .set_style_text_font (lv .font_montserrat_12 , 0 )
93100 self .difficulty_label .set_style_text_color (lv .color_hex (0xFFFFFF ), 0 )
94101 self .difficulty_label .center ()
95102
96- # Status label (top right)
97- self .status_label = lv .label (self .screen )
98- self .status_label .set_text ("Your turn!" )
99- self .status_label .set_style_text_font (lv .font_montserrat_12 , 0 )
100- self .status_label .set_style_text_color (lv .color_hex (0xFFFFFF ), 0 )
101- self .status_label .set_pos (self .SCREEN_WIDTH - 95 , 10 )
103+ # New Game button (top right)
104+ new_game_btn = lv .button (self .screen )
105+ new_game_btn .set_size (70 , 26 )
106+ new_game_btn .align (lv .ALIGN .TOP_RIGHT , - 5 , 5 )
107+ new_game_btn .add_event_cb (lambda e : self .new_game (), lv .EVENT .CLICKED , None )
108+ new_game_label = lv .label (new_game_btn )
109+ new_game_label .set_text ("New" )
110+ new_game_label .set_style_text_font (lv .font_montserrat_12 , 0 )
111+ new_game_label .center ()
102112
103113 # Create board background
104114 board_bg = lv .obj (self .screen )
@@ -141,15 +151,6 @@ def onCreate(self):
141151 btn .add_event_cb (lambda e , c = col : self .on_column_click (c ), lv .EVENT .CLICKED , None )
142152 self .column_buttons .append (btn )
143153
144- # New Game button
145- new_game_btn = lv .button (self .screen )
146- new_game_btn .set_size (100 , 30 )
147- new_game_btn .align (lv .ALIGN .BOTTOM_MID , 0 , - 5 )
148- new_game_btn .add_event_cb (lambda e : self .new_game (), lv .EVENT .CLICKED , None )
149- new_game_label = lv .label (new_game_btn )
150- new_game_label .set_text ("New Game" )
151- new_game_label .center ()
152-
153154 self .setContentView (self .screen )
154155
155156 def onResume (self , screen ):
@@ -160,7 +161,7 @@ def cycle_difficulty(self, event):
160161 return
161162 self .difficulty = (self .difficulty + 1 ) % 3
162163 difficulty_names = ["Easy" , "Medium" , "Hard" ]
163- self .difficulty_label .set_text (f"Difficulty: { difficulty_names [self .difficulty ]} " )
164+ self .difficulty_label .set_text (difficulty_names [self .difficulty ])
164165 self .difficulty_label .center ()
165166
166167 def on_column_click (self , col ):
0 commit comments