From: Maria Bialota Date: Fri, 19 Apr 2024 14:15:10 +0000 (+0200) Subject: [API10][NUI][AT-SPI] Fixed Dialog and AlertDialog behaviour X-Git-Tag: submit/tizen_7.0/20240429.150828~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d266298f45b608d44c23cea7382e9d188b42eea;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [API10][NUI][AT-SPI] Fixed Dialog and AlertDialog behaviour --- diff --git a/src/Tizen.NUI.Components/Controls/AlertDialog.cs b/src/Tizen.NUI.Components/Controls/AlertDialog.cs old mode 100755 new mode 100644 index 642bfaf63..5f9d261c8 --- a/src/Tizen.NUI.Components/Controls/AlertDialog.cs +++ b/src/Tizen.NUI.Components/Controls/AlertDialog.cs @@ -79,6 +79,9 @@ namespace Tizen.NUI.Components return; } + AddedToWindow -= OnAddedToWindow; + RemovedFromWindow -= OnRemovedFromWindow; + if (type == DisposeTypes.Explicit) { if (titleContent != null) @@ -461,7 +464,14 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] protected override string AccessibilityGetDescription() { - return Message; + if (!String.IsNullOrEmpty(Title)) + { + return Message; + } + else + { + return ""; + } } /// @@ -472,9 +482,19 @@ namespace Tizen.NUI.Components { base.OnInitialize(); AccessibilityRole = Role.Dialog; + } + + private void OnAddedToWindow(object sender, EventArgs e) + { Show(); // calls RegisterDefaultLabel(); Hide() will call UnregisterDefaultLabel() } + private void OnRemovedFromWindow(object sender, EventArgs e) + { + Hide(); + } + + /// /// Informs AT-SPI bridge about the set of AT-SPI states associated with this object. /// @@ -558,7 +578,9 @@ namespace Tizen.NUI.Components linearLayout.CellPadding = new Size2D(alertDialogStyle.ItemSpacing.Width, alertDialogStyle.ItemSpacing.Height); } - this.Relayout += OnRelayout; + Relayout += OnRelayout; + AddedToWindow += OnAddedToWindow; + RemovedFromWindow += OnRemovedFromWindow; TitleContent = DefaultTitleContent; diff --git a/src/Tizen.NUI.Components/Controls/Dialog.cs b/src/Tizen.NUI.Components/Controls/Dialog.cs index 3bf4ee9af..8c69f0747 100755 --- a/src/Tizen.NUI.Components/Controls/Dialog.cs +++ b/src/Tizen.NUI.Components/Controls/Dialog.cs @@ -52,7 +52,9 @@ namespace Tizen.NUI.Components { Layout = new AbsoluteLayout(); - this.Relayout += OnRelayout; + Relayout += OnRelayout; + AddedToWindow += OnAddedToWindow; + RemovedFromWindow += OnRemovedFromWindow; } /// @@ -93,6 +95,9 @@ namespace Tizen.NUI.Components return; } + AddedToWindow -= OnAddedToWindow; + RemovedFromWindow -= OnRemovedFromWindow; + if (type == DisposeTypes.Explicit) { this.Relayout -= OnRelayout; @@ -159,9 +164,18 @@ namespace Tizen.NUI.Components { base.OnInitialize(); AccessibilityRole = Role.Dialog; + } + + private void OnAddedToWindow(object sender, EventArgs e) + { Show(); // calls RegisterDefaultLabel(); Hide() will call UnregisterDefaultLabel() } + private void OnRemovedFromWindow(object sender, EventArgs e) + { + Hide(); + } + /// /// Informs AT-SPI bridge about the set of AT-SPI states associated with this object. ///