-
-
Notifications
You must be signed in to change notification settings - Fork 48
feat: add graphical renderer foundation with U8g2 adapter #408
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
Merged
forntoh
merged 5 commits into
feat/graphical-display
from
gd/03-graphical-renderer-foundation-u8g2
Apr 23, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2b06445
feat: add graphical renderer foundation with U8g2 adapter
forntoh 87024f9
test: align MenuScreen expectations with clamped viewport behavior
forntoh 17267e9
refactor: slim graphical renderer and restore baseline screen flow
forntoh 6234a28
refactor: trim graphical renderer extension surface
forntoh 46bb13a
fix: align list glyph bitmap height with drawXbm
forntoh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| Graphical display renderer | ||
| ========================== | ||
|
|
||
| The graphical display renderer targets pixel-addressable displays through | ||
| :cpp:class:`GraphicalDisplayInterface`. | ||
|
|
||
| It is designed for U8g2-driven modules, including OLED displays such as | ||
| SSD1306 and monochrome graphical LCDs such as ST7920. | ||
|
|
||
| Features | ||
| -------- | ||
|
|
||
| - Dynamic row and column calculation from the active font metrics | ||
| - Row highlighting for selection and value-area highlighting while editing | ||
| - Checkbox rendering for boolean items and toggles | ||
| - Scrollbar and value indicators for widget-driven items | ||
| - Buffered drawing with renderer-managed frame flushing | ||
| - Per-item custom fonts (any U8g2 font) | ||
|
|
||
| Basic usage | ||
| ----------- | ||
|
|
||
| .. code-block:: cpp | ||
|
|
||
| #include <U8g2lib.h> | ||
| #include <display/U8g2DisplayAdapter.h> | ||
| #include <renderer/GraphicalDisplayRenderer.h> | ||
|
|
||
| U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE); | ||
| U8g2DisplayAdapter display(&u8g2); | ||
| GraphicalDisplayRenderer renderer(&display, u8g2_font_6x10_tf); | ||
|
|
||
| MENU_SCREEN(mainScreen, mainItems, | ||
| ITEM_FONT(ITEM_LABEL("Overview"), u8g2_font_7x13B_tf), | ||
| ITEM_BOOL("Enabled", true, "ON", "OFF", nullptr)); | ||
|
|
||
| void setup() { | ||
| renderer.begin(); | ||
| renderer.setItemFont(mainItems[1], u8g2_font_6x13_tf); | ||
| } | ||
|
forntoh marked this conversation as resolved.
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Relative docs link won't resolve on GitHub's README view.
[display interfaces](reference/api/display/index)is a Sphinx-style intra-doc link — GitHub will render it ashttps://github.com/forntoh/LcdMenu/blob/.../reference/api/display/index, which 404s. Since this README is the primary entry point on GitHub, consider an absolute URL to the hosted docs so readers clicking from GitHub land on a real page.🔗 Proposed fix
🤖 Prompt for AI Agents