Skip to content

Commit e929a21

Browse files
authored
* KryptonToast no longer works properly (#3302)
# 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" />
2 parents f4444f8 + 1675c42 commit e929a21

30 files changed

Lines changed: 94 additions & 29 deletions

File tree

Documents/Changelog/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
## 2026-11-xx - Build 2611 (V110 Nightly) - November 2026
4747

48+
* Resolved [#3018](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3018), `KryptonToast` no longer works properly
4849
* Resolved [#3227](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3227), `KryptonDockingManager.LoadConfigFromArray` throws exception
4950
* Resolved [#3225](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3225), Ribbon large button image-to-text separator not DPI-scaled
5051
* Resolved [#3256](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3256), Tree View Event is Crashing

Source/Krypton Components/Krypton.Utilities/Components/KryptonToast/Controls Visuals/Basic/LTR/VisualToastBasicForm.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region BSD License
1+
#region BSD License
22
/*
33
*
44
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
@@ -71,6 +71,8 @@ public VisualToastBasicForm(KryptonBasicToastData data)
7171

7272
private void UpdateText()
7373
{
74+
GlobalStaticValues.ApplyToastRichTextContentColor(krtbNotificationContentText);
75+
7476
krtbNotificationContentText.Text = _basicToastNotificationData.NotificationContent ?? string.Empty;
7577

7678
klblHeader.Text = _basicToastNotificationData.NotificationTitle;

Source/Krypton Components/Krypton.Utilities/Components/KryptonToast/Controls Visuals/Basic/LTR/VisualToastBasicWithProgressBarForm.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region BSD License
1+
#region BSD License
22
/*
33
*
44
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
@@ -90,6 +90,8 @@ public KryptonToastResult NotificationResult
9090

9191
private void UpdateText()
9292
{
93+
GlobalStaticValues.ApplyToastRichTextContentColor(krtbNotificationContentText);
94+
9395
krtbNotificationContentText.Text = _basicToastNotificationData.NotificationContent ?? string.Empty;
9496

9597
klblHeader.Text = _basicToastNotificationData.NotificationTitle;

Source/Krypton Components/Krypton.Utilities/Components/KryptonToast/Controls Visuals/Basic/RTL/VisualToastBasicRtlAwareForm.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region BSD License
1+
#region BSD License
22
/*
33
*
44
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
@@ -67,6 +67,8 @@ public VisualToastBasicRtlAwareForm(KryptonBasicToastData toastNotificationData)
6767

6868
private void UpdateText()
6969
{
70+
GlobalStaticValues.ApplyToastRichTextContentColor(krtbNotificationContentText);
71+
7072
krtbNotificationContentText.Text = _basicToastNotificationData.NotificationContent ?? string.Empty;
7173

7274
klblHeader.Text = _basicToastNotificationData.NotificationTitle;

Source/Krypton Components/Krypton.Utilities/Components/KryptonToast/Controls Visuals/Basic/RTL/VisualToastBasicWithProgressBarRtlAwareForm.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region BSD License
1+
#region BSD License
22
/*
33
*
44
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
@@ -67,6 +67,8 @@ public VisualToastBasicWithProgressBarRtlAwareForm(KryptonBasicToastData data)
6767

6868
private void UpdateText()
6969
{
70+
GlobalStaticValues.ApplyToastRichTextContentColor(krtbNotificationContentText);
71+
7072
krtbNotificationContentText.Text = _basicToastNotificationData.NotificationContent ?? string.Empty;
7173

7274
klblHeader.Text = _basicToastNotificationData.NotificationTitle;

Source/Krypton Components/Krypton.Utilities/Components/KryptonToast/Controls Visuals/User Input/LTR/Normal/VisualToastComboBoxUserInputForm.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region BSD License
1+
#region BSD License
22
/*
33
*
44
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
@@ -55,6 +55,8 @@ private void UpdateBorderColors()
5555

5656
private void UpdateText()
5757
{
58+
GlobalStaticValues.ApplyToastRichTextContentColor(krtbNotificationContentText);
59+
5860
klblHeader.Text = _data.NotificationTitle ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;
5961

6062
krtbNotificationContentText.Text = _data.NotificationContent ?? GlobalStaticValues.DEFAULT_EMPTY_STRING;

Source/Krypton Components/Krypton.Utilities/Components/KryptonToast/Controls Visuals/User Input/LTR/Normal/VisualToastDateTimeUserInputForm.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region BSD License
1+
#region BSD License
22
/*
33
*
44
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
@@ -54,6 +54,8 @@ private void UpdateBorderColors()
5454

5555
private void UpdateText()
5656
{
57+
GlobalStaticValues.ApplyToastRichTextContentColor(krtbNotificationContentText);
58+
5759
klblHeader.Text = _data.NotificationTitle;
5860

5961
krtbNotificationContentText.Text = _data.NotificationContent;

Source/Krypton Components/Krypton.Utilities/Components/KryptonToast/Controls Visuals/User Input/LTR/Normal/VisualToastDomainUpDownUserInputForm.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region BSD License
1+
#region BSD License
22
/*
33
*
44
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
@@ -55,6 +55,8 @@ private void UpdateBorderColors()
5555

5656
private void UpdateText()
5757
{
58+
GlobalStaticValues.ApplyToastRichTextContentColor(krtbNotificationContentText);
59+
5860
klblHeader.Text = _data.NotificationTitle;
5961

6062
krtbNotificationContentText.Text = _data.NotificationContent;

Source/Krypton Components/Krypton.Utilities/Components/KryptonToast/Controls Visuals/User Input/LTR/Normal/VisualToastMaskedTextBoxUserInputForm.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region BSD License
1+
#region BSD License
22
/*
33
*
44
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
@@ -55,6 +55,8 @@ private void UpdateBorderColors()
5555

5656
private void UpdateText()
5757
{
58+
GlobalStaticValues.ApplyToastRichTextContentColor(krtbNotificationContentText);
59+
5860
klblHeader.Text = _data.NotificationTitle;
5961

6062
krtbNotificationContentText.Text = _data.NotificationContent;

Source/Krypton Components/Krypton.Utilities/Components/KryptonToast/Controls Visuals/User Input/LTR/Normal/VisualToastNUDUserInputForm.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region BSD License
1+
#region BSD License
22
/*
33
*
44
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
@@ -55,6 +55,8 @@ private void UpdateBorderColors()
5555

5656
private void UpdateText()
5757
{
58+
GlobalStaticValues.ApplyToastRichTextContentColor(krtbNotificationContentText);
59+
5860
klblHeader.Text = _data.NotificationTitle;
5961

6062
krtbNotificationContentText.Text = _data.NotificationContent;

0 commit comments

Comments
 (0)