Skip to content

refactor(raylib): Move widgets to the widgets folder#35680

Merged
sshane merged 16 commits intocommaai:masterfrom
TheSecurityDev:restructure-widgets
Jul 11, 2025
Merged

refactor(raylib): Move widgets to the widgets folder#35680
sshane merged 16 commits intocommaai:masterfrom
TheSecurityDev:restructure-widgets

Conversation

@TheSecurityDev
Copy link
Contributor

@TheSecurityDev TheSecurityDev commented Jul 10, 2025

Summary and reason for change:

I've found the raylib code structure a bit random. There are several components that extend the Widget class (and some that don't but should) that aren't in the widgets folder, so I've moved them there and updated the imports (sorting as necessary).

Also I moved the Widget class into the base file of the widgets module to make imports a bit less verbose.

List of changes:

Moved files:

  1. system/ui/lib/widget.pysystem/ui/widgets/__init__.py
  2. system/ui/lib/button.pysystem/ui/widgets/button.py (not a Widget class but probably should be)
  3. system/ui/lib/inputbox.pysystem/ui/widgets/inputbox.py
  4. system/ui/lib/label.pysystem/ui/widgets/label.py (not a Widget class but probably should be)
  5. system/ui/lib/list_view.pysystem/ui/widgets/list_view.py
  6. system/ui/lib/scroller.pysystem/ui/widgets/scroller.py
  7. system/ui/lib/toggle.pysystem/ui/widgets/toggle.py

@github-actions github-actions bot added the ui label Jul 10, 2025
@sshane
Copy link
Contributor

sshane commented Jul 11, 2025

Yes, we're sort of doing things in stages or as we touch them. Things should use Widget if possible. Scroller should be a widget, but scroll panel should not since it doesn't deal with rendering and instead handles mouse clicks. Can we keep that in lib/?

Can you also see about making the classes you moved use Widget (and remove some code in the process by using the Widget class's helpers)?

@TheSecurityDev
Copy link
Contributor Author

Scroller should be a widget, but scroll panel should not since it doesn't deal with rendering and instead handles mouse clicks. Can we keep that in lib/?

Sounds, good. I've updated it.

Can you also see about making the classes you moved use Widget (and remove some code in the process by using the Widget class's helpers)?

I'll see what I can do, but I also have a few other things I want to look at.

@sshane sshane merged commit 5751c61 into commaai:master Jul 11, 2025
16 checks passed
@sshane
Copy link
Contributor

sshane commented Jul 11, 2025

I see they're functions right now, that's okay to do in a separate PR. I started here: #35571

@TheSecurityDev
Copy link
Contributor Author

I see they're functions right now, that's okay to do in a separate PR. I started here: #35571

I'm working on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants