mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[Color Picker - Editor] Accessibility: Screen Reader announces 'Copied to Clipboard' (#12373)
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Automation.Peers;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
@@ -90,6 +91,20 @@ namespace ColorPicker.Controls
|
|||||||
resize.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseInOut };
|
resize.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseInOut };
|
||||||
ColorCopiedNotificationBorder.BeginAnimation(Border.OpacityProperty, opacityAppear);
|
ColorCopiedNotificationBorder.BeginAnimation(Border.OpacityProperty, opacityAppear);
|
||||||
ColorCopiedNotificationBorder.BeginAnimation(Border.HeightProperty, resize);
|
ColorCopiedNotificationBorder.BeginAnimation(Border.HeightProperty, resize);
|
||||||
|
|
||||||
|
var clipboardNotification = ((Decorator)ColorCopiedNotificationBorder).Child;
|
||||||
|
if (clipboardNotification == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var peer = UIElementAutomationPeer.FromElement(clipboardNotification);
|
||||||
|
if (peer == null)
|
||||||
|
{
|
||||||
|
peer = UIElementAutomationPeer.CreatePeerForElement(clipboardNotification);
|
||||||
|
}
|
||||||
|
|
||||||
|
peer.RaiseAutomationEvent(AutomationEvents.MenuOpened);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HideCopiedIndicator()
|
private void HideCopiedIndicator()
|
||||||
|
|||||||
@@ -173,7 +173,9 @@
|
|||||||
<TextBlock FontSize="16"
|
<TextBlock FontSize="16"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" >
|
VerticalAlignment="Center"
|
||||||
|
AutomationProperties.LiveSetting="Assertive"
|
||||||
|
AutomationProperties.Name="{x:Static p:Resources.Copied_to_clipboard}">
|
||||||
<Run Text=" " FontFamily="Segoe MDL2 Assets"/>
|
<Run Text=" " FontFamily="Segoe MDL2 Assets"/>
|
||||||
<Run Text="{x:Static p:Resources.Copied_to_clipboard}" FontWeight="SemiBold"/>
|
<Run Text="{x:Static p:Resources.Copied_to_clipboard}" FontWeight="SemiBold"/>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|||||||
Reference in New Issue
Block a user