mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 00:03:45 +08:00
raylib: remove gui_button (#36229)
* vibing can be good * and listview * rm that * html render * text.py * ssh keys * updater w/ Auto * wow gpt5 actually is better * well this is better * huh wifi still doesn't work * lfg * lint * manager waits for exit * wait a minute this changes nothing * this will work * whoops * clean up html * actually useless * clean up option * typing * bump
This commit is contained in:
@@ -6,8 +6,8 @@ from typing import Any
|
||||
from openpilot.system.ui.lib.application import gui_app, FontWeight
|
||||
from openpilot.system.ui.lib.scroll_panel import GuiScrollPanel
|
||||
from openpilot.system.ui.lib.wrap_text import wrap_text
|
||||
from openpilot.system.ui.widgets import Widget, DialogResult
|
||||
from openpilot.system.ui.widgets.button import gui_button, ButtonStyle
|
||||
from openpilot.system.ui.widgets import Widget
|
||||
from openpilot.system.ui.widgets.button import Button, ButtonStyle
|
||||
|
||||
|
||||
class ElementType(Enum):
|
||||
@@ -40,6 +40,7 @@ class HtmlRenderer(Widget):
|
||||
self._normal_font = gui_app.font(FontWeight.NORMAL)
|
||||
self._bold_font = gui_app.font(FontWeight.BOLD)
|
||||
self._scroll_panel = GuiScrollPanel()
|
||||
self._ok_button = Button("OK", click_callback=lambda: gui_app.set_modal_overlay(None), button_style=ButtonStyle.PRIMARY)
|
||||
|
||||
self.styles: dict[ElementType, dict[str, Any]] = {
|
||||
ElementType.H1: {"size": 68, "weight": FontWeight.BOLD, "color": rl.BLACK, "margin_top": 20, "margin_bottom": 16},
|
||||
@@ -126,10 +127,9 @@ class HtmlRenderer(Widget):
|
||||
button_x = content_rect.x + content_rect.width - button_width
|
||||
button_y = content_rect.y + content_rect.height - button_height
|
||||
button_rect = rl.Rectangle(button_x, button_y, button_width, button_height)
|
||||
if gui_button(button_rect, "OK", button_style=ButtonStyle.PRIMARY) == 1:
|
||||
return DialogResult.CONFIRM
|
||||
self._ok_button.render(button_rect)
|
||||
|
||||
return DialogResult.NO_ACTION
|
||||
return -1
|
||||
|
||||
def _render_content(self, rect: rl.Rectangle, scroll_offset: float = 0) -> float:
|
||||
current_y = rect.y + scroll_offset
|
||||
|
||||
Reference in New Issue
Block a user