-
Notifications
You must be signed in to change notification settings - Fork 334
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
Syntax highlighting of entity paths and instance paths #4803
Conversation
cac6f8e
to
7a5cb05
Compare
7a5cb05
to
6243e3c
Compare
@@ -26,6 +26,9 @@ all-features = true | |||
default = [] | |||
|
|||
[dependencies] | |||
re_entity_db.workspace = true # syntax-highlighting for InstancePath. TODO(emilk): move InstancePath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move instance path to where?
aren't these making re_ui a lot less lightweight?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move instance path to where?
It feels like it belongs in a more low-level crate, like re_types
aren't these making re_ui a lot less lightweight?
Yes. The alternative is to create yet another crate, or add more feature flags, and both kind of sucks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat! A bit too subtle for my taste, but clear improvement
|
||
use egui::{text::LayoutJob, Color32, Style, TextFormat}; | ||
|
||
pub trait SyntaxHighlighting { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it actually syntax highlighting or just "make this an egui text"? ToLayoutJob
might be just as appropriate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed live: we'll probably use this trait for more syntax highlighting stuff in the future, and that's what you want to search for in the code. Still, we can revisit the name later if we want to.
What
Adds basic syntax highlighting to patsh. Slashes and brackets are in a fixed bright-white color, while the text uses the color appropriate for the widget it is in (labels are dimmer than button, for instance).
For labels this produces a lot of contrast:
For buttons, not so much:
Checklist
main
build: app.rerun.ionightly
build: app.rerun.io