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

[glass] Add Alerts widget #7219

Merged

Conversation

rmheuer
Copy link
Contributor

@rmheuer rmheuer commented Oct 16, 2024

This adds a widget to Glass for the Alerts published with https://github.com/wpilibsuite/allwpilib/blob/main/wpilibj/src/main/java/edu/wpi/first/wpilibj/Alert.java.

Screenshot from 2024-10-16 11-53-14

Currently the types of messages are distinguished by a label and by color. I think it would be nice to add icons like this:
https://raw.githubusercontent.com/Mechanical-Advantage/NetworkAlerts/main/example.png
The icons would be nice to make it more obvious and be helpful for people with color blindness. I'm not sure what the best way to do that is, so I would appreciate help with it.

@rmheuer rmheuer requested a review from a team as a code owner October 16, 2024 17:07
@PeterJohnson
Copy link
Member

PeterJohnson commented Oct 16, 2024

Easiest would be to find some relevant Font Awesome icons; these are available via this header: https://github.com/wpilibsuite/allwpilib/blob/main/thirdparty/imgui_suite/generated/fonts/include/IconsFontAwesome6.h (these are injected into all the fonts, so you just string concat the macro value and output it as text). E.g. ICON_FA_CIRCLE_INFO

@rmheuer
Copy link
Contributor Author

rmheuer commented Oct 16, 2024

The icons were surprisingly easy with those, thank you! The widget looks like this now:
image

@PeterJohnson PeterJohnson merged commit f7dddb8 into wpilibsuite:main Oct 16, 2024
33 checks passed

void Update() override;
bool Exists() override;
bool IsReadOnly() override { return false; }
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with Glass- Could someone explain if this is accurate? I don't see any code to respond to changes on the client side.

@rmheuer rmheuer deleted the glass_alerts branch October 16, 2024 21:13
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