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.
[MouseJump] move Mouse Jump settings into separate control (microsoft…
- Loading branch information
1 parent
dc7c7ef
commit 6dcbd29
Showing
7 changed files
with
279 additions
and
200 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
117 changes: 117 additions & 0 deletions
117
src/settings-ui/Settings.UI/SettingsXAML/Panels/MouseJumpPanel.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,117 @@ | ||
<UserControl | ||
x:Class="Microsoft.PowerToys.Settings.UI.Panels.MouseJumpPanel" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls" | ||
xmlns:converters="using:Microsoft.PowerToys.Settings.UI.Converters" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls" | ||
xmlns:tkconverters="using:CommunityToolkit.WinUI.Converters" | ||
xmlns:ui="using:CommunityToolkit.WinUI" | ||
AutomationProperties.LandmarkType="Main" | ||
mc:Ignorable="d"> | ||
|
||
<controls:SettingsGroup x:Uid="MouseUtils_MouseJump"> | ||
|
||
<tkcontrols:SettingsCard | ||
x:Uid="MouseUtils_Enable_MouseJump" | ||
HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/Icons/MouseJump.png}" | ||
IsEnabled="{x:Bind ViewModel.IsJumpEnabledGpoConfigured, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"> | ||
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.IsMouseJumpEnabled, Mode=TwoWay}" /> | ||
</tkcontrols:SettingsCard> | ||
|
||
<InfoBar | ||
x:Uid="GPO_SettingIsManaged" | ||
IsClosable="False" | ||
IsOpen="{x:Bind ViewModel.IsJumpEnabledGpoConfigured, Mode=OneWay}" | ||
IsTabStop="{x:Bind ViewModel.IsJumpEnabledGpoConfigured, Mode=OneWay}" | ||
Severity="Informational" /> | ||
|
||
<tkcontrols:SettingsCard | ||
x:Uid="MouseUtils_MouseJump_ActivationShortcut" | ||
HeaderIcon="{ui:FontIcon Glyph=}" | ||
IsEnabled="{x:Bind ViewModel.IsMouseJumpEnabled, Mode=OneWay}"> | ||
<controls:ShortcutControl MinWidth="{StaticResource SettingActionControlMinWidth}" HotkeySettings="{x:Bind Path=ViewModel.MouseJumpActivationShortcut, Mode=TwoWay}" /> | ||
</tkcontrols:SettingsCard> | ||
|
||
<tkcontrols:SettingsCard | ||
|
||
x:Uid="MouseUtils_MouseJump_ThumbnailSize" | ||
HeaderIcon="{ui:FontIcon Glyph=}" | ||
IsEnabled="{x:Bind ViewModel.IsMouseJumpEnabled, Mode=OneWay}"> | ||
<tkcontrols:SettingsCard.Description> | ||
<StackPanel | ||
Grid.Row="1" | ||
Grid.Column="1" | ||
Margin="0,4,0,0" | ||
Orientation="Horizontal"> | ||
<TextBlock | ||
x:Uid="MouseUtils_MouseJump_ThumbnailSize_Description_Prefix" | ||
Margin="0,0,4,0" | ||
Style="{ThemeResource SecondaryTextStyle}" /> | ||
<TextBlock | ||
Margin="0,0,4,0" | ||
FontWeight="SemiBold" | ||
Style="{ThemeResource SecondaryTextStyle}" | ||
Text="{x:Bind ViewModel.MouseJumpThumbnailSize.Width, Mode=OneWay}" /> | ||
<TextBlock | ||
Margin="0,5,4,0" | ||
AutomationProperties.AccessibilityView="Raw" | ||
FontFamily="{ThemeResource SymbolThemeFontFamily}" | ||
FontSize="10" | ||
Foreground="{ThemeResource SystemBaseMediumColor}" | ||
Style="{ThemeResource SecondaryTextStyle}" | ||
Text="" /> | ||
<TextBlock | ||
Margin="0,0,4,0" | ||
FontWeight="SemiBold" | ||
Style="{ThemeResource SecondaryTextStyle}" | ||
Text="{x:Bind ViewModel.MouseJumpThumbnailSize.Height, Mode=OneWay}" /> | ||
<TextBlock | ||
x:Uid="MouseUtils_MouseJump_ThumbnailSize_Description_Suffix" | ||
Margin="0,0,4,0" | ||
Foreground="{ThemeResource SystemBaseMediumColor}" | ||
Style="{ThemeResource SecondaryTextStyle}" /> | ||
</StackPanel> | ||
</tkcontrols:SettingsCard.Description> | ||
<StackPanel | ||
Grid.Column="2" | ||
HorizontalAlignment="Right" | ||
Orientation="Horizontal" | ||
Spacing="8"> | ||
<Button | ||
x:Uid="EditButton" | ||
Width="40" | ||
Height="36" | ||
Content="" | ||
FontFamily="{ThemeResource SymbolThemeFontFamily}" | ||
Style="{StaticResource SubtleButtonStyle}"> | ||
<ToolTipService.ToolTip> | ||
<TextBlock x:Uid="EditTooltip" /> | ||
</ToolTipService.ToolTip> | ||
<Button.Flyout> | ||
<Flyout x:Uid="MouseJumpThumbnailSize_Edit" ShouldConstrainToRootBounds="False"> | ||
<StackPanel Spacing="16"> | ||
<NumberBox | ||
x:Uid="MouseUtils_MouseJump_ThumbnailSize_Edit_Width" | ||
Width="140" | ||
Minimum="160" | ||
SpinButtonPlacementMode="Compact" | ||
Value="{x:Bind ViewModel.MouseJumpThumbnailSize.Width, Mode=TwoWay}" /> | ||
<NumberBox | ||
x:Uid="MouseUtils_MouseJump_ThumbnailSize_Edit_Height" | ||
Width="140" | ||
Minimum="120" | ||
SpinButtonPlacementMode="Compact" | ||
Value="{x:Bind ViewModel.MouseJumpThumbnailSize.Height, Mode=TwoWay}" /> | ||
</StackPanel> | ||
</Flyout> | ||
</Button.Flyout> | ||
</Button> | ||
</StackPanel> | ||
</tkcontrols:SettingsCard> | ||
|
||
</controls:SettingsGroup> | ||
|
||
</UserControl> |
19 changes: 19 additions & 0 deletions
19
src/settings-ui/Settings.UI/SettingsXAML/Panels/MouseJumpPanel.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,19 @@ | ||
// 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 Microsoft.PowerToys.Settings.UI.ViewModels; | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace Microsoft.PowerToys.Settings.UI.Panels | ||
{ | ||
public sealed partial class MouseJumpPanel : UserControl | ||
{ | ||
internal MouseUtilsViewModel ViewModel { get; set; } | ||
|
||
public MouseJumpPanel() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.