feat: add ring component#817
Open
enieuwy wants to merge 19 commits into
Open
Conversation
|
Neat. I just found this. I actually made my own icon font for a similar use case. Battery charging icon with 100 different levels, so that i can accurately see the battery level. |
Author
|
I tried a similar first approach, and raised another PR for SF symbols accepting values for their variables. Was limited by the symbols available and had inconsistent results. The ring component allows huge flexibility. It can even mimic a loading spinner, which is nice to show my VPN connecting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
SketchyBar's
graphis great for timeseries, andslideris great for the common "0–100% of one thing" case (battery, audio level, focus percentage, pomodoro). However, a circular variant can show greater scale while occupying less bar space—think of how iOS shows battery levels for several devices (earbuds, phone, watch) in a small widget.This PR adds a compact circular
ringcomponent with a centered marker glyph and optional badge, stacked on top of the badge feature in #816.What
--add ring <name> <position> <diameter>.ring.value(0.0–1.0),ring.percentage(read-only mirror),ring.color,ring.track_color,ring.line_width,ring.start_angle,ring.clockwise,ring.cap,ring.marker.*, andring.badge.*.--animatemachinery overring.value.bar_itemlike other components; marker glyph and badge are non-layout overlays, so the ring footprint is exactly its diameter.Demo
Demo recording: badge-and-ring-demo.mp4
Stacking
This PR is stacked on #816. Until #816 lands, the upstream PR diff may include badge-base changes; the clean ring-only diff remains visible in enieuwy#1.
The CoreAnimation follow-up is enieuwy#2. It is intentionally separate so the component API can be reviewed independently from the CA/SkyLight surface backend.
Verification
make arm64builds clean.~/dev/SketchyBar/bin/sketchybar;--query battery.ringand--query bluetooth.ringexercised on the live daemon. Marker and badge fields serialize correctly.__ring_live_testitem) confirmed all ring properties round-trip via--query.