11import pyray as rl
22from openpilot .common .params import Params
3- from openpilot .system .ui .lib .application import gui_app , FontWeight
3+ from openpilot .system .ui .lib .application import gui_app , FontWeight , FONT_SCALE
44from openpilot .system .ui .widgets import Widget
55
66
@@ -9,7 +9,7 @@ def __init__(self):
99 super ().__init__ ()
1010
1111 self .img_width = 80
12- self .horizontal_padding = 50
12+ self .horizontal_padding = 25
1313 self .button_height = 125
1414
1515 self .params = Params ()
@@ -31,11 +31,6 @@ def _draw_gradient_background(self, rect):
3131 rl .draw_rectangle_gradient_h (int (rect .x ), int (rect .y ), int (rect .width ), int (rect .height ),
3232 start_color , end_color )
3333
34- def _handle_mouse_release (self , mouse_pos ):
35- self .experimental_mode = not self .experimental_mode
36- # TODO: Opening settings for ExperimentalMode
37- self .params .put_bool ("ExperimentalMode" , self .experimental_mode )
38-
3934 def _render (self , rect ):
4035 rl .draw_rectangle_rounded (rect , 0.08 , 20 , rl .WHITE )
4136
@@ -51,7 +46,7 @@ def _render(self, rect):
5146 # Draw text label (left aligned)
5247 text = "EXPERIMENTAL MODE ON" if self .experimental_mode else "CHILL MODE ON"
5348 text_x = rect .x + self .horizontal_padding
54- text_y = rect .y + rect .height / 2 - 45 // 2 # Center vertically
49+ text_y = rect .y + rect .height / 2 - 45 * FONT_SCALE // 2 # Center vertically
5550
5651 rl .draw_text_ex (gui_app .font (FontWeight .NORMAL ), text , rl .Vector2 (int (text_x ), int (text_y )), 45 , 0 , rl .BLACK )
5752
0 commit comments