Skip to content
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

[NUI] Make View.TooltipText return valid value #5639

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions src/Tizen.NUI/src/public/BaseComponents/View.cs
Original file line number Diff line number Diff line change
Expand Up @@ -866,12 +866,24 @@ private string InternalTooltipText
{
using (var propertyValue = GetProperty(Property.TOOLTIP))
{
if (propertyValue != null && propertyValue.Get(out string retrivedValue))
using var propertyMap = new PropertyMap();
if (propertyValue != null && propertyValue.Get(propertyMap))
{
return retrivedValue;
using var retrivedContentValue = propertyMap?.Find(NDalic.TooltipContent);
if (retrivedContentValue != null)
{
using var contextPropertyMap = new PropertyMap();
if (retrivedContentValue.Get(contextPropertyMap))
{
using var retrivedTextValue = contextPropertyMap?.Find(NDalic.TextVisualText);
if (retrivedTextValue != null && retrivedTextValue.Get(out string retrivedValue))
{
return retrivedValue;
}
}
}
}
NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
return "error to get TooltipText";
return "";
}
}
set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,24 @@ public void ColorBlue_GET_SET_VALUE()

testView.Dispose();
}


[Test]
[Category("P1")]
[Description("Get value test for View.ToolTipText")]
[Property("SPEC", "Tizen.NUI.BaseComponents.View.ToolTipText")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRW")]
[Property("AUTHOR", "[email protected]")]
public void ToolTipText_GET_SET_VALUE()
{
/* TEST CODE */
View testView = new View();

testView.TooltipText = "tooltipText";
Assert.AreEqual("tooltipText", testView.TooltipText, "Should get equal string value what we set before");

testView.Dispose();
}
}
}
Loading