71 auto* gfx =
static_cast<Gdey029T94*
>(
display->getNativeHandle());
74 const uint16_t width =
display->getWidth();
75 const uint16_t height =
display->getHeight();
78 int boxX = (width - BOX_WIDTH) / 2;
79 int boxY = (height - BOX_HEIGHT) / 2;
84 gfx->setTextColor(EPD_BLACK);
88 int textX = boxX + 15;
89 int textY = boxY + 20;
93 int iconX = boxX + 20;
94 int iconY = boxY + 22;
99 gfx->drawCircle(iconX, iconY, 8, EPD_BLACK);
100 gfx->setCursor(iconX - 3, iconY + 4);
106 gfx->drawTriangle(iconX, iconY - 7, iconX - 7, iconY + 6, iconX + 7, iconY + 6, EPD_BLACK);
107 gfx->fillRect(iconX - 1, iconY - 2, 2, 5, EPD_BLACK);
108 gfx->fillRect(iconX - 1, iconY + 4, 2, 2, EPD_BLACK);
113 gfx->drawCircle(iconX, iconY, 8, EPD_BLACK);
114 gfx->drawLine(iconX - 4, iconY - 4, iconX + 4, iconY + 4, EPD_BLACK);
115 gfx->drawLine(iconX - 4, iconY + 4, iconX + 4, iconY - 4, EPD_BLACK);
126 gfx->setCursor(textX, textY);
129 const char* ptr = message_;
131 int maxLineWidth = BOX_WIDTH - (textX - boxX) - 10;
137 const char* wordEnd = ptr;
138 while (*wordEnd && *wordEnd !=
' ' && *wordEnd !=
'\n') wordEnd++;
140 int wordLen = wordEnd - ptr;
143 if (lineLen + wordLen + 1 < (
int)
sizeof(lineBuf) - 1 &&
144 (lineLen + wordLen) * 6 < maxLineWidth) {
147 lineBuf[lineLen++] =
' ';
149 memcpy(lineBuf + lineLen, ptr, wordLen);
154 lineBuf[lineLen] =
'\0';
155 gfx->setCursor(textX, lineY);
161 memcpy(lineBuf, ptr, wordLen);
166 while (*ptr ==
' ') ptr++;
169 lineBuf[lineLen] =
'\0';
170 gfx->setCursor(textX, lineY);
180 lineBuf[lineLen] =
'\0';
181 gfx->setCursor(textX, lineY);
185 const char* hint =
ui::tr(
"core.hint_approve_deny");
186 int hintWidth =
static_cast<int>(std::strlen(hint)) * 6;
187 gfx->setCursor(boxX + BOX_WIDTH / 2 - hintWidth / 2, boxY + BOX_HEIGHT - 12);
void showConfirm(const char *message, ConfirmView::ConfirmCallback onConfirm, ConfirmView::CancelCallback onCancel=nullptr, ConfirmView::Icon icon=ConfirmView::Icon::QUESTION, void *userData=nullptr)
Shows a shared modal confirmation dialog instance.