| 398 | } |
| 399 | |
| 400 | bool TextWidget::isStaticText(YAGfx& gfx, uint16_t textBoxWidth, uint16_t textBoxHeight) const |
| 401 | { |
| 402 | bool isStatic = false; |
| 403 | |
| 404 | /* Single line text widget? */ |
| 405 | if (1U >= getLineCount()) |
| 406 | { |
| 407 | /* As long as the text box is smaller than the available width, |
| 408 | * the text can be static shown (no scrolling). |
| 409 | */ |
| 410 | if (gfx.getWidth() >= textBoxWidth) |
| 411 | { |
| 412 | isStatic = true; |
| 413 | } |
| 414 | } |
| 415 | /* Multi-line text widget */ |
| 416 | else |
| 417 | { |
| 418 | /* As long as the text box is smaller than the available height, |
| 419 | * the text can be static shown (no scrolling). |
| 420 | */ |
| 421 | if (gfx.getHeight() >= textBoxHeight) |
| 422 | { |
| 423 | isStatic = true; |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | return isStatic; |
| 428 | } |
| 429 | |
| 430 | void TextWidget::prepareNewText(YAGfx& gfx) |
| 431 | { |