mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-19 15:03:36 +08:00
[Color Picker - Editor] Accessibility: Screen Reader announces 'Copied to Clipboard' (#12373)
This commit is contained in:
parent
d583b083d1
commit
e965fcb690
@ -4,6 +4,7 @@
|
||||
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Automation.Peers;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
@ -90,6 +91,20 @@ namespace ColorPicker.Controls
|
||||
resize.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseInOut };
|
||||
ColorCopiedNotificationBorder.BeginAnimation(Border.OpacityProperty, opacityAppear);
|
||||
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()
|
||||
|
@ -173,7 +173,9 @@
|
||||
<TextBlock FontSize="16"
|
||||
Foreground="White"
|
||||
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="{x:Static p:Resources.Copied_to_clipboard}" FontWeight="SemiBold"/>
|
||||
</TextBlock>
|
||||
|
Loading…
Reference in New Issue
Block a user