mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
[FindMyMouse]Support different activation modes (#28096)
* multiple activation modes for find my mouse * use custom shortcut
This commit is contained in:
committed by
GitHub
parent
752c298ef3
commit
83f0625427
@@ -3,26 +3,20 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Converters
|
||||
{
|
||||
public sealed class FindMyMouseActivationShakeMouseIntToVisibilityConverter : IValueConverter
|
||||
public sealed class FindMyMouseActivationIntToVisibilityConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
var activationShake = (int)value;
|
||||
var selectedActivation = (int)value;
|
||||
var expectedActivation = int.Parse(parameter as string, CultureInfo.InvariantCulture);
|
||||
|
||||
// Assumes 1 is the index for the shake mouse option in the activation method combo box
|
||||
if (activationShake == 1)
|
||||
{
|
||||
return Visibility.Visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Visibility.Collapsed;
|
||||
}
|
||||
return selectedActivation == expectedActivation ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
Reference in New Issue
Block a user