-
Notifications
You must be signed in to change notification settings - Fork 104
I159-Fix tooltip background was not updated when the theme was changed. #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I159-Fix tooltip background was not updated when the theme was changed. #176
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where the tooltip background was not updating when the theme was changed by replacing calls to the old SetDefaultTooltipValue method with inline fallback logic and a new centralized UpdateTooltipAppearance method.
- Removed SetDefaultTooltipValue calls and adjusted tooltip property fallback logic across chart components.
- Updated unit tests and default behavior tests to reflect the new dynamic update approach.
- Consolidated tooltip appearance updates into a common method in ChartSeries.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| maui/tests/Syncfusion.Maui.Toolkit.UnitTest/Chart/Features/ChartUnitTests.cs | Updated tests to assert tooltip property values directly from the chart instance. |
| maui/tests/Syncfusion.Maui.Toolkit.UnitTest/Chart/DefaultTests/BehaviorDefaultTests.cs | Adjusted expectations for default tooltip values to match new logic. |
| maui/src/Charts/SfPyramidChart.cs, SfPolarChart.cs, SfFunnelChart.cs, etc. | Replaced old SetDefaultTooltipValue calls with inline fallback logic via UpdateTooltipAppearance. |
| maui/src/Charts/Series/* | Removed individual assignments for tooltip properties and centralized appearance updates via UpdateTooltipAppearance. |
| maui/src/Charts/ChartBase.cs, Behaviors/ChartTooltipBehavior.cs | Removed legacy default value creators and SetDefaultTooltipValue, updating default handling for tooltip behavior. |
Comments suppressed due to low confidence (1)
maui/src/Charts/ChartBase.cs:684
- The removal of the SetDefaultTooltipValue call here means that default tooltip properties are no longer initialized immediately. Please verify that scenarios such as SaveAsImage properly trigger UpdateTooltipAppearance so that fallback values are correctly applied.
SetDefaultTooltipValue(_defaultToolTipBehavior);
|
The tooltip background doesn't update dynamically when changing the theme with AppThemeBinding. We have addressed four cases for this fix: Case 1: If AppThemeBinding is used or a specific value is set for the tooltip background, that value should be applied as the background. Case 2: If the Syncfusion TooltipBackground resource key is used to set the tooltip background, it should be applied as the background. Case 3: If no values are set for the background, default values should be applied. Case 4: If both a specific background value and the Syncfusion resource key are used, the specific background value should take priority, and the resource key values should be ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes fine.
Description
When setting the AppThemeBinding to tooltipBehavior background color, the tooltip background was not updated when the theme was changed.
#159
Root Cause of the Issue
To set the internal property values to the behavior background property, the binding property was overridden to the value property, so the appthemebinding values were not dynamically updated.
Changes description
Set the Behavior background property value to tooltipinfo. If it is null means to set the tooltip background that was applied in the resource key, and if it is also null means to set the default values for the tooltip background.
Test cases
Test this cases for Caresian, Circular, Funnel, Pyramid and Polar chart.
Screenshots
Before:
BeforeChanges.mp4
After:
AfterChanges.mp4