Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/renderer/GraphicalDisplayRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class GraphicalDisplayRenderer : public MenuRenderer,
void captureCurrentFontMetrics();
void applyItemFont(const MenuItem* item);

protected:
uint8_t measureText(const char* text) const;
uint8_t toggleIndicatorWidth() const;
uint8_t rowHeight() const;
Expand All @@ -72,6 +73,19 @@ class GraphicalDisplayRenderer : public MenuRenderer,
void setDefaultFont(const uint8_t* font);
bool setItemFont(MenuItem* item, const uint8_t* font);

/**
* @brief Gets the item currently rendered as active (focused).
* @return Pointer to the active item, or NULL when no item is active.
*/
const MenuItem* getActiveItem() const { return activeItem; }

/**
* @brief Checks whether the given item is the currently active item.
* @param item Item to check, may be NULL.
* @return true when the given item matches the active item.
*/
bool isActiveItem(const MenuItem* item) const { return activeItem != NULL && activeItem == item; }
Comment thread
forntoh marked this conversation as resolved.

void begin() override;
void beginFrame() override;
void endFrame() override;
Expand Down
Loading