163 auto* gfx =
static_cast<Gdey029T94*
>(
display->getNativeHandle());
166 const uint16_t screenWidth =
display->getWidth();
167 const uint16_t screenHeight =
display->getHeight();
171 uint16_t maxLabelWidth = 0;
176 for (uint8_t i = 0; i < itemCount_; i++) {
177 if (items_[i].label) {
179 gfx->getTextBounds(items_[i].label, 0, 0, &x1, &y1, &w, &h);
180 if (w > maxLabelWidth) maxLabelWidth = w;
187 gfx->getTextBounds(title_, 0, 0, &x1, &y1, &w, &h);
188 if (w > maxLabelWidth) maxLabelWidth = w;
191 uint16_t boxWidth = maxLabelWidth +
BOX_PADDING * 2 + 10;
199 int boxX = (screenWidth - boxWidth) / 2;
200 int boxY = (screenHeight - boxHeight) / 2;
206 gfx->setTextColor(EPD_WHITE);
207 gfx->fillRect(boxX + 2, boxY + 2, boxWidth - 4,
TITLE_HEIGHT, EPD_BLACK);
215 for (uint8_t i = 0; i < visibleCount; i++) {
216 uint8_t itemIndex = scrollPos_ + i;
217 if (itemIndex >= itemCount_)
break;
225 if (itemIndex == selection_) {
227 gfx->setTextColor(EPD_WHITE);
229 gfx->setTextColor(EPD_BLACK);
246 if (scrollPos_ > 0) {
248 indicatorX, indicatorY + 6,
249 indicatorX - 3, indicatorY + 2,
250 indicatorX + 3, indicatorY + 2,
260 indicatorX - 3, arrowY + 4,
261 indicatorX + 3, arrowY + 4,