better raylib

This commit is contained in:
firestar5683
2026-06-12 00:58:42 -05:00
parent 21b1bfd600
commit 140b047e7f
6 changed files with 286 additions and 34 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import pyray as rl
from enum import IntEnum
from typing import TypeVar
from collections.abc import Callable
from openpilot.system.hardware import PC
from openpilot.system.ui.lib.application import gui_app, MousePos, MAX_TOUCH_SLOTS, MouseEvent
try:
@@ -162,7 +163,7 @@ class Widget(abc.ABC):
elif mouse_event.left_released:
self._handle_mouse_event(mouse_event)
if self.__is_pressed[mouse_event.slot] and mouse_in_rect:
if (self.__is_pressed[mouse_event.slot] or PC) and mouse_in_rect:
self._handle_mouse_release(mouse_event.pos)
self.__is_pressed[mouse_event.slot] = False
self.__tracking_is_pressed[mouse_event.slot] = False
+1
View File
@@ -38,6 +38,7 @@ def gui_label(
alignment_vertical: int = rl.GuiTextAlignmentVertical.TEXT_ALIGN_MIDDLE,
elide_right: bool = True
):
text = str(_resolve_value(text))
font = gui_app.font(font_weight)
text_size = measure_text_cached(font, text, font_size)
display_text = text