mirror of
https://github.com/microsoft/PowerToys
synced 2025-08-31 14:35:18 +00:00
Announce opening Edit Layout dialog (#13963)
This commit is contained in:
@@ -217,7 +217,7 @@ namespace FancyZonesEditor
|
||||
name = name.TrimEnd();
|
||||
}
|
||||
|
||||
AnnounceSuccessfulLayoutCreation(name);
|
||||
Announce(name, FancyZonesEditor.Properties.Resources.Layout_Creation_Announce);
|
||||
int maxCustomIndex = 0;
|
||||
foreach (LayoutModel customModel in MainWindowSettingsModel.CustomModels)
|
||||
{
|
||||
@@ -249,12 +249,12 @@ namespace FancyZonesEditor
|
||||
App.FancyZonesEditorIO.SerializeZoneSettings();
|
||||
}
|
||||
|
||||
private void AnnounceSuccessfulLayoutCreation(string name)
|
||||
private void Announce(string name, string message)
|
||||
{
|
||||
if (AutomationPeer.ListenerExists(AutomationEvents.MenuOpened))
|
||||
{
|
||||
var peer = UIElementAutomationPeer.FromElement(_createLayoutAnnounce);
|
||||
AutomationProperties.SetName(_createLayoutAnnounce, name + " " + FancyZonesEditor.Properties.Resources.Layout_Creation_Announce);
|
||||
AutomationProperties.SetName(_createLayoutAnnounce, name + " " + message);
|
||||
peer?.RaiseAutomationEvent(AutomationEvents.MenuOpened);
|
||||
}
|
||||
}
|
||||
@@ -454,6 +454,7 @@ namespace FancyZonesEditor
|
||||
|
||||
private void Dialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
|
||||
{
|
||||
Announce(sender.Name, FancyZonesEditor.Properties.Resources.Edit_Layout_Open_Announce);
|
||||
_openedDialog = sender;
|
||||
}
|
||||
|
||||
|
@@ -284,6 +284,15 @@ namespace FancyZonesEditor.Properties {
|
||||
return ResourceManager.GetString("Edit_Layout", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to opened.
|
||||
/// </summary>
|
||||
public static string Edit_Layout_Open_Announce {
|
||||
get {
|
||||
return ResourceManager.GetString("Edit_Layout_Open_Announce", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Edit zones.
|
||||
|
@@ -374,6 +374,9 @@
|
||||
<data name="Edit_Layout" xml:space="preserve">
|
||||
<value>Edit layout</value>
|
||||
</data>
|
||||
<data name="Edit_Layout_Open_Announce" xml:space="preserve">
|
||||
<value>opened</value>
|
||||
</data>
|
||||
<data name="Layout_Creation_Announce" xml:space="preserve">
|
||||
<value>custom layout was created successfully.</value>
|
||||
</data>
|
||||
|
Reference in New Issue
Block a user