Skip to content
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

ui: Initial UI rewrite using pyray (spinner and text window) #34583

Merged
merged 13 commits into from
Feb 15, 2025

Conversation

deanlee
Copy link
Contributor

@deanlee deanlee commented Feb 14, 2025

The styles still need refinement, and additional improvements are required. However, this should be sufficient as an initial version to start with.

@deanlee deanlee force-pushed the pyray_init_version branch 3 times, most recently from 1d63cd9 to 49ec688 Compare February 14, 2025 08:16
@deanlee deanlee marked this pull request as ready for review February 14, 2025 08:34
@deanlee deanlee closed this Feb 14, 2025
@deanlee deanlee reopened this Feb 14, 2025
@maxime-desroches
Copy link
Contributor

image

I have this artifact on the spinner texture

Copy link
Contributor

@adeebshihadeh adeebshihadeh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose we structure it like this:

system/ui/
  spinner.py
  text.py
  lib/
    application.py

system/ui/raylib/spinner.py Outdated Show resolved Hide resolved
@deanlee deanlee marked this pull request as draft February 15, 2025 02:11
@deanlee
Copy link
Contributor Author

deanlee commented Feb 15, 2025

I have this artifact on the spinner texture

resolved

@deanlee deanlee marked this pull request as ready for review February 15, 2025 03:06
self._view = rl.Rectangle()
self._show_vertical_scroll_bar: bool = show_vertical_scroll_bar

def handle_scroll(self)-> rl.Vector2:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scrolling with a wheel doesn't feel natural

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

system/ui/spinner.py Outdated Show resolved Hide resolved
system/ui/spinner.py Show resolved Hide resolved
Comment on lines +52 to +57
rl.begin_scissor_mode(int(textarea_rect.x), int(textarea_rect.y), int(textarea_rect.width), int(textarea_rect.height))
for i, line in enumerate(wrapped_lines):
position = rl.Vector2(textarea_rect.x + scroll.x, textarea_rect.y + scroll.y + i * LINE_HEIGHT)
rl.draw_text_ex(gui_app.font(), line.strip(), position, FONT_SIZE, 0, rl.WHITE)
rl.end_scissor_mode()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the text area tears while scrolling

Copy link
Contributor Author

@deanlee deanlee Feb 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deanlee
Copy link
Contributor Author

deanlee commented Feb 15, 2025

@maxime-desroches I propose switching to the official raylib library instead of our custom-built wheel on PC. This should help avoid the version 'GLIBC_2.38' not found issue.

@adeebshihadeh
Copy link
Contributor

Already done - 9ccfecb

@deanlee deanlee marked this pull request as draft February 15, 2025 04:30
@deanlee deanlee marked this pull request as ready for review February 15, 2025 06:38
@adeebshihadeh adeebshihadeh merged commit ce7ff5c into commaai:master Feb 15, 2025
16 checks passed
@deanlee deanlee deleted the pyray_init_version branch February 16, 2025 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants