[API10][NUI][AT-SPI] Fixed Dialog and AlertDialog behaviour
authorMaria Bialota <m.bialota@samsung.com>
Fri, 19 Apr 2024 14:15:10 +0000 (16:15 +0200)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 29 Apr 2024 07:58:07 +0000 (16:58 +0900)
src/Tizen.NUI.Components/Controls/AlertDialog.cs [changed mode: 0755->0644]
src/Tizen.NUI.Components/Controls/Dialog.cs

old mode 100755 (executable)
new mode 100644 (file)
index 642bfaf..5f9d261
@@ -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 "";
+            }
         }
 
         /// <summary>
@@ -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();
+        }
+
+
         /// <summary>
         /// Informs AT-SPI bridge about the set of AT-SPI states associated with this object.
         /// </summary>
@@ -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;
 
index 3bf4ee9..8c69f07 100755 (executable)
@@ -52,7 +52,9 @@ namespace Tizen.NUI.Components
         {
             Layout = new AbsoluteLayout();
 
-            this.Relayout += OnRelayout;
+            Relayout += OnRelayout;
+            AddedToWindow += OnAddedToWindow;
+            RemovedFromWindow += OnRemovedFromWindow;
         }
 
         /// <summary>
@@ -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();
+        }
+
         /// <summary>
         /// Informs AT-SPI bridge about the set of AT-SPI states associated with this object.
         /// </summary>