forked from microsoft/PowerToys
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [FZ Editor] Custom button with automation event on click (microsoft#12338) * Custom button with automation event on click * Rename MyButton to ClickAutomationEventButton * Rename property to OnClickAutomationValue * Remove unneeded line * [FZE] Send close signal to Editor when the main app closes (microsoft#12510) * [Settings/ImageResizer] New UI for sizes listview (microsoft#12269) * Flyout for ImageResizer sizes * Narrator support * Improved spaces * Fixed icons and added a confirmation dialog * Add updatesourcetrigger * Spellcheck fix * Fixed missing strings * Added messagedialog * Fixes * Focus fix * Accesibility fix Co-authored-by: Niels Laute <niels9001@hotmail.com> * [Setup] Better prevent FileInUse errors during install (microsoft#12512) * [ColorPicker] Close only flyout with escape key (microsoft#12441) When the escape key is pressed in the Color Picker editor, only the adjust color flyout should be closed instead of the whole window. * [Bug Report Tool] Get Settings event viewer data (microsoft#12521) Adds the event viewer events of PowerToys.Settings.exe to bug reports. Co-authored-by: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com> Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com> Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: Niels Laute <niels9001@hotmail.com>
- Loading branch information
1 parent
6164433
commit b965624
Showing
25 changed files
with
1,826 additions
and
1,508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/modules/fancyzones/editor/FancyZonesEditor/ClickAutomationEventButton.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Button x:Class="FancyZonesEditor.ClickAutomationEventButton" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:FancyZonesEditor" | ||
mc:Ignorable="d" | ||
d:DesignHeight="450" d:DesignWidth="800"> | ||
</Button> |
105 changes: 105 additions & 0 deletions
105
src/modules/fancyzones/editor/FancyZonesEditor/ClickAutomationEventButton.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Windows; | ||
using System.Windows.Automation; | ||
using System.Windows.Automation.Peers; | ||
using System.Windows.Automation.Provider; | ||
using System.Windows.Controls; | ||
|
||
namespace FancyZonesEditor | ||
{ | ||
public partial class ClickAutomationEventButton : Button | ||
{ | ||
public ClickAutomationEventButton() | ||
: base() | ||
{ | ||
InitializeComponent(); | ||
Click += OnClick; | ||
} | ||
|
||
public string OnClickAutomationValue | ||
{ | ||
get { return (string)GetValue(OnClickAutomationValueProperty); } | ||
set { SetValue(OnClickAutomationValueProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty OnClickAutomationValueProperty = | ||
DependencyProperty.Register( | ||
"Value", typeof(string), typeof(ClickAutomationEventButton)); | ||
|
||
private void OnClick(object sender, RoutedEventArgs e) | ||
{ | ||
if (AutomationPeer.ListenerExists(AutomationEvents.PropertyChanged)) | ||
{ | ||
ClickAutomationEventButtonAutomationPeer peer = | ||
UIElementAutomationPeer.FromElement(this) as ClickAutomationEventButtonAutomationPeer; | ||
|
||
if (peer != null) | ||
{ | ||
peer.RaisePropertyChangedEvent( | ||
ValuePatternIdentifiers.ValueProperty, | ||
null, | ||
OnClickAutomationValue); | ||
} | ||
} | ||
} | ||
|
||
protected override AutomationPeer OnCreateAutomationPeer() | ||
{ | ||
return new ClickAutomationEventButtonAutomationPeer(this); | ||
} | ||
|
||
public class ClickAutomationEventButtonAutomationPeer : FrameworkElementAutomationPeer, IValueProvider | ||
{ | ||
public ClickAutomationEventButtonAutomationPeer(ClickAutomationEventButton control) | ||
: base(control) | ||
{ | ||
} | ||
|
||
protected override string GetClassNameCore() | ||
{ | ||
return nameof(ClickAutomationEventButton); | ||
} | ||
|
||
protected override AutomationControlType GetAutomationControlTypeCore() | ||
{ | ||
return AutomationControlType.Button; | ||
} | ||
|
||
public override object GetPattern(PatternInterface patternInterface) | ||
{ | ||
if (patternInterface == PatternInterface.Value) | ||
{ | ||
return this; | ||
} | ||
|
||
return base.GetPattern(patternInterface); | ||
} | ||
|
||
public void SetValue(string value) | ||
{ | ||
MyOwner.OnClickAutomationValue = value; | ||
} | ||
|
||
private ClickAutomationEventButton MyOwner | ||
{ | ||
get | ||
{ | ||
return (ClickAutomationEventButton)Owner; | ||
} | ||
} | ||
|
||
public string Value | ||
{ | ||
get { return MyOwner.OnClickAutomationValue; } | ||
} | ||
|
||
public bool IsReadOnly | ||
{ | ||
get { return !IsEnabled(); } | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.