Commit e929a21
authored
*
# Fix KryptonToast notification body text visibility (#3018)
## Summary
Fixes a regression where toast notification **body text** could appear
missing (especially on darker themes) after `KryptonToast` lived in
`Krypton.Utilities`. The title and layout were fine; the read-only
**`KryptonRichTextBox`** used for the message did not apply a
label-appropriate foreground colour.
## Issue
- [Bug: KryptonToast no longer works properly —
#3018](#3018)
## Root cause
Toast forms use **`KryptonRichTextBox`** with
**`InputControlStyle.PanelClient`** and **`ReadOnly = true`** to show
static content while matching form chrome. That combination can take the
**input-control** colour path while the control is drawn like **text on
a panel**, so foreground and background colours may coincide (invisible
text).
The same situation was already addressed for **`KryptonMessageBox`** in
[#1692](#1692)
by setting:
`StateCommon.Content.Color1` from
`GlobalStaticValues.KryptonMessageBoxRichTextBoxTextColor` (palette:
`LabelNormalPanel` long text, normal state).
Toast visuals never applied that adjustment after the move to
`Krypton.Utilities`.
## Solution
1. **`Krypton.Utilities` — `GlobalStaticValues`**
- Added internal helper
**`ApplyToastRichTextContentColor(KryptonRichTextBox)`**, which assigns
`StateCommon.Content.Color1` using the same source as the message box
(`KryptonMessageBoxRichTextBoxTextColor`).
2. **All toast visual forms** that host
**`krtbNotificationContentText`**
- At the start of **`UpdateText()`**, call
**`GlobalStaticValues.ApplyToastRichTextContentColor(krtbNotificationContentText)`**
before assigning the notification text.
This covers basic toasts (LTR/RTL, with and without progress bar) and
user-input toasts (all LTR/RTL and progress-bar variants). Only the
read-only rich text used for the **notification content** is affected.
## Out of scope (by design)
Editable toast controls (`KryptonTextBox`, `KryptonComboBox`,
`KryptonNumericUpDown`, etc.) use normal input styling, **not**
`PanelClient` for the rich-text workaround. They should continue to use
the theme’s input colours; the message-box label colour is not
appropriate for those controls.
## How to verify
1. Run **`ToastNotificationQuickTestForm`** or
**`UserInputToastNotificationTest`** (or any code path that calls
`KryptonToast.ShowBasicNotification` / `ShowNotification`).
2. Switch to a **dark** palette (for example Office 2010 Black or
another high-contrast dark theme).
3. Confirm **notification title** and **body** text are both readable.
## Checklist
- [x] Behaviour aligned with `VisualMessageBoxForm` /
`VisualMessageBoxRtlAwareForm` rich text handling
([#1692](#1692)).
<img width="670" height="254" alt="image"
src="https://github.com/user-attachments/assets/5a2cb92f-a395-4b81-8bcd-9d1b528b215b"
/>KryptonToast no longer works properly (#3302)30 files changed
Lines changed: 94 additions & 29 deletions
File tree
- Documents/Changelog
- Source/Krypton Components/Krypton.Utilities/Components/KryptonToast
- Controls Visuals
- Basic
- LTR
- RTL
- User Input
- LTR
- Normal
- ProgressBar
- RTL
- Normal
- ProgressBar
- General
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
0 commit comments