restore MultiTouchMode function

This commit is contained in:
ChanginJolly 2024-05-01 22:48:28 +08:00
parent 9703fe9fbf
commit 1aea793aba
8 changed files with 62 additions and 25 deletions

View File

@ -511,6 +511,8 @@
<ItemGroup>
<Resource Include="Resources\Icons-Fluent\ic_fluent_control_button_24_regular.png" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Resource Include="Resources\Icons-Fluent\ic_fluent_people_24_regular.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -254,13 +254,6 @@
<TextBlock Text="退出" Foreground="Black" VerticalAlignment="Bottom" HorizontalAlignment="Center" FontSize="12"/>
</Grid>
</Border>
<!--
<Border Width="36" Height="36" MouseDown="Border_MouseDown" MouseUp="BorderMultiTouchMode_MouseUp" CornerRadius="5" Background="White" BorderThickness="1" BorderBrush="{DynamicResource FloatBarBorderBrush}">
<Viewbox Margin="8">
<ui:SymbolIcon Name="SymbolIconMultiTouchMode" Symbol="People" Foreground="{DynamicResource FloatBarForeground}" />
</Viewbox>
</Border>
-->
</ui:SimpleStackPanel>
</Grid>
</Viewbox>
@ -278,19 +271,24 @@
</Grid>
</Border>
<Grid Margin="0,0,0,5" Width="0">
<Border Name="BoardTwoFingerGestureBorder" Margin="-115,-125,-55,54" CornerRadius="5" Background="LightGray" Opacity="0.85" BorderBrush="Black" BorderThickness="1">
<Border Name="BoardTwoFingerGestureBorder" Margin="-115,-160,-55,54" CornerRadius="5" Background="LightGray" Opacity="0.85" BorderBrush="Black" BorderThickness="1">
<ui:SimpleStackPanel Margin="13">
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Center">
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Resources/Icons-Fluent/ic_fluent_people_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="20" Width="20"/>
<Label Content="多指书写" FontSize="15" VerticalAlignment="Center"/>
<ui:ToggleSwitch MinWidth="0" Width="42" Name="BoardToggleSwitchEnableMultiTouchMode" FontFamily="Microsoft YaHei UI" IsOn="False" OnContent="" OffContent="" Toggled="ToggleSwitchEnableMultiTouchMode_Toggled"/>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Opacity="{Binding ElementName=TwoFingerGestureSimpleStackPanel, Path=Opacity}" Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Resources/Icons-Fluent/ic_fluent_drag_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="20" Width="20"/>
<Label Content="双指移动" FontSize="15" VerticalAlignment="Center"/>
<ui:ToggleSwitch MinWidth="0" Width="42" Name="BoardToggleSwitchEnableTwoFingerTranslate" FontFamily="Microsoft YaHei UI" IsOn="False" OnContent="" OffContent="" Toggled="ToggleSwitchEnableTwoFingerTranslate_Toggled"/>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Center">
<ui:SimpleStackPanel Opacity="{Binding ElementName=TwoFingerGestureSimpleStackPanel, Path=Opacity}" Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Resources/Icons-Fluent/ic_fluent_scale_fit_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="20" Width="20"/>
<Label Content="双指缩放" FontSize="15" VerticalAlignment="Center"/>
<ui:ToggleSwitch MinWidth="0" Width="42" Name="BoardToggleSwitchEnableTwoFingerZoom" FontFamily="Microsoft YaHei UI" IsOn="False" OnContent="" OffContent="" Toggled="ToggleSwitchEnableTwoFingerZoom_Toggled"/>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Center">
<ui:SimpleStackPanel Opacity="{Binding ElementName=TwoFingerGestureSimpleStackPanel, Path=Opacity}" Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Resources/Icons-Fluent/ic_fluent_arrow_rotate_clockwise_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="20" Width="20"/>
<Label Content="双指旋转" FontSize="15" VerticalAlignment="Center"/>
<ui:ToggleSwitch MinWidth="0" Width="42" Name="BoardToggleSwitchEnableTwoFingerRotation" FontFamily="Microsoft YaHei UI" OnContent="" OffContent="" Toggled="ToggleSwitchEnableTwoFingerRotation_Toggled"/>
@ -1617,19 +1615,24 @@
<Image x:Name="EnableTwoFingerGestureBtn" Source="/Resources/Icons-png/twoFingelMove.png" RenderOptions.BitmapScalingMode="HighQuality" Height="20" Width="30"/>
</Border>
<Grid Width="0">
<Border Name="TwoFingerGestureBorder" Visibility="Collapsed" Margin="-105,-132,-67,44" CornerRadius="5" Background="white" Opacity="0.9" BorderBrush="Black" BorderThickness="1">
<Border Name="TwoFingerGestureBorder" Visibility="Visible" Margin="-105,-165,-67,44" CornerRadius="5" Background="white" Opacity="0.9" BorderBrush="Black" BorderThickness="1">
<ui:SimpleStackPanel Margin="13">
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Resources/Icons-Fluent/ic_fluent_people_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="20" Width="20"/>
<Label Content="多指书写" FontSize="15" VerticalAlignment="Center"/>
<ui:ToggleSwitch MinWidth="0" Width="42" Name="ToggleSwitchEnableMultiTouchMode" FontFamily="Microsoft YaHei UI" IsOn="False" OnContent="" OffContent="" Toggled="ToggleSwitchEnableMultiTouchMode_Toggled"/>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Opacity="1" x:Name="TwoFingerGestureSimpleStackPanel" Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Resources/Icons-Fluent/ic_fluent_drag_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="20" Width="20"/>
<Label Content="双指移动" FontSize="15" VerticalAlignment="Center"/>
<ui:ToggleSwitch MinWidth="0" Width="42" OnContent="" OffContent="" Name="ToggleSwitchEnableTwoFingerTranslate" FontFamily="Microsoft YaHei UI" IsOn="False" Toggled="ToggleSwitchEnableTwoFingerTranslate_Toggled"/>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Center">
<ui:SimpleStackPanel Opacity="{Binding ElementName=TwoFingerGestureSimpleStackPanel, Path=Opacity}" Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Resources/Icons-Fluent/ic_fluent_scale_fit_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="20" Width="20"/>
<Label Content="双指缩放" FontSize="15" VerticalAlignment="Center"/>
<ui:ToggleSwitch MinWidth="0" Width="42" OnContent="" OffContent="" Name="ToggleSwitchEnableTwoFingerZoom" FontFamily="Microsoft YaHei UI" IsOn="False" Toggled="ToggleSwitchEnableTwoFingerZoom_Toggled"/>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Center">
<ui:SimpleStackPanel Opacity="{Binding ElementName=TwoFingerGestureSimpleStackPanel, Path=Opacity}" Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Resources/Icons-Fluent/ic_fluent_arrow_rotate_clockwise_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="20" Width="20"/>
<Label Content="双指旋转" FontSize="15" VerticalAlignment="Center"/>
<ui:ToggleSwitch MinWidth="0" Width="42" OnContent="" OffContent="" Name="ToggleSwitchEnableTwoFingerRotation" FontFamily="Microsoft YaHei UI" Toggled="ToggleSwitchEnableTwoFingerRotation_Toggled"/>

View File

@ -143,8 +143,20 @@ namespace Ink_Canvas {
}
private void CheckEnableTwoFingerGestureBtnColorPrompt() {
EnableTwoFingerGestureBtn.Source = Settings.Gesture.IsEnableTwoFingerGesture ? new BitmapImage(new Uri("/Resources/Icons-png/twoFingelMove-Blue.png", UriKind.Relative)) : new BitmapImage(new Uri("/Resources/Icons-png/twoFingelMove.png", UriKind.Relative));
BoardEnableTwoFingerGestureBtn.Source = Settings.Gesture.IsEnableTwoFingerGesture ? new BitmapImage(new Uri("/Resources/Icons-png/twoFingelMove-Blue.png", UriKind.Relative)) : new BitmapImage(new Uri("/Resources/Icons-png/twoFingelMove.png", UriKind.Relative));
if (ToggleSwitchEnableMultiTouchMode.IsOn) {
TwoFingerGestureSimpleStackPanel.Opacity = 0.5;
EnableTwoFingerGestureBtn.Source = new BitmapImage(new Uri("/Resources/Icons-png/twoFingelMove.png", UriKind.Relative));
BoardEnableTwoFingerGestureBtn.Source = new BitmapImage(new Uri("/Resources/Icons-png/twoFingelMove.png", UriKind.Relative));
} else {
TwoFingerGestureSimpleStackPanel.Opacity = 1;
if (Settings.Gesture.IsEnableTwoFingerGesture) {
EnableTwoFingerGestureBtn.Source = new BitmapImage(new Uri("/Resources/Icons-png/twoFingelMove-Blue.png", UriKind.Relative));
BoardEnableTwoFingerGestureBtn.Source = new BitmapImage(new Uri("/Resources/Icons-png/twoFingelMove-Blue.png", UriKind.Relative));
} else {
EnableTwoFingerGestureBtn.Source = new BitmapImage(new Uri("/Resources/Icons-png/twoFingelMove.png", UriKind.Relative));
BoardEnableTwoFingerGestureBtn.Source = new BitmapImage(new Uri("/Resources/Icons-png/twoFingelMove.png", UriKind.Relative));
}
}
}
private void CheckEnableTwoFingerGestureBtnVisibility(bool isVisible) {
@ -392,11 +404,10 @@ namespace Ink_Canvas {
RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
//进入黑板
if (Settings.Gesture.AutoSwitchTwoFingerGesture) // 自动开启双指移动
if (Settings.Gesture.AutoSwitchTwoFingerGesture) // 自动关闭多指书写、开启双指移动
{
if (isInMultiTouchMode) ToggleSwitchEnableMultiTouchMode.IsOn = false;
ToggleSwitchEnableTwoFingerTranslate.IsOn = true;
//ToggleSwitchEnableTwoFingerZoom.IsOn = false;
//ToggleSwitchEnableTwoFingerRotation.IsOn = false;
}
/*
@ -434,19 +445,16 @@ namespace Ink_Canvas {
}
}
if (Settings.Gesture.AutoSwitchTwoFingerGesture) // 自动关闭双指移动
if (Settings.Gesture.AutoSwitchTwoFingerGesture) // 自动启用多指书写
{
ToggleSwitchEnableTwoFingerTranslate.IsOn = false;
if (!isInMultiTouchMode) ToggleSwitchEnableMultiTouchMode.IsOn = true;
}
if (Settings.Automation.IsAutoSaveStrokesAtClear && inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber) {
SaveScreenShot(true);
}
if (isInMultiTouchMode) BorderMultiTouchMode_MouseUp(null, null);
if (BtnPPTSlideShowEnd.Visibility == Visibility.Collapsed) {
new Thread(new ThreadStart(() => {
Thread.Sleep(100);

View File

@ -448,6 +448,23 @@ namespace Ink_Canvas {
SaveSettingsToFile();
}
private void ToggleSwitchEnableMultiTouchMode_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
if (sender == ToggleSwitchEnableMultiTouchMode) {
BoardToggleSwitchEnableMultiTouchMode.IsOn = ToggleSwitchEnableMultiTouchMode.IsOn;
} else {
ToggleSwitchEnableMultiTouchMode.IsOn = BoardToggleSwitchEnableMultiTouchMode.IsOn;
}
if (ToggleSwitchEnableMultiTouchMode.IsOn) {
if (!isInMultiTouchMode) BorderMultiTouchMode_MouseUp(null, null);
} else {
if (isInMultiTouchMode) BorderMultiTouchMode_MouseUp(null, null);
}
Settings.Gesture.IsEnableMultiTouchMode = ToggleSwitchEnableMultiTouchMode.IsOn;
CheckEnableTwoFingerGestureBtnColorPrompt();
SaveSettingsToFile();
}
private void ToggleSwitchEnableTwoFingerTranslate_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
if (sender == ToggleSwitchEnableTwoFingerTranslate) {

View File

@ -212,6 +212,11 @@ namespace Ink_Canvas {
}
// Gesture
if (Settings.Gesture != null) {
if (Settings.Gesture.IsEnableMultiTouchMode) {
ToggleSwitchEnableMultiTouchMode.IsOn = true;
} else {
ToggleSwitchEnableMultiTouchMode.IsOn = false;
}
if (Settings.Gesture.IsEnableTwoFingerZoom) {
ToggleSwitchEnableTwoFingerZoom.IsOn = true;
BoardToggleSwitchEnableTwoFingerZoom.IsOn = true;

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -59,6 +59,8 @@ namespace Ink_Canvas
public bool IsEnableTwoFingerGesture => IsEnableTwoFingerZoom || IsEnableTwoFingerTranslate || IsEnableTwoFingerRotation;
[JsonIgnore]
public bool IsEnableTwoFingerGestureTranslateOrRotation => IsEnableTwoFingerTranslate || IsEnableTwoFingerRotation;
[JsonProperty("isEnableMultiTouchMode")]
public bool IsEnableMultiTouchMode { get; set; } = true;
[JsonProperty("isEnableTwoFingerZoom")]
public bool IsEnableTwoFingerZoom { get; set; } = true;
[JsonProperty("isEnableTwoFingerTranslate")]