Skip to content

Commit

Permalink
Updating dependencies & fixing typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementGre committed Jun 14, 2024
1 parent 26462d6 commit 7150780
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 62 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This allows you to drag windows and select text (by emulating a cursor drag hold
## Preview
<p align="center">
<img src='https://raw.githubusercontent.com/ClementGre/ThreeFingerDragOnWindows/main/ThreeFingerDragOnWindows/Assets/Screenshot-1.png' alt="App screenshot: Touchpad tab" width='700'>
<img src='https://raw.githubusercontent.com/ClementGre/ThreeFingerDragOnWindows/main/ThreeFingerDragOnWindows/Assets/Screenshot-2.png' alt="App screenshot: Three Fingers Drag tab" width='700'>
<img src='https://raw.githubusercontent.com/ClementGre/ThreeFingerDragOnWindows/main/ThreeFingerDragOnWindows/Assets/Screenshot-2.png' alt="App screenshot: Three Finger Drag tab" width='700'>
<img src='https://raw.githubusercontent.com/ClementGre/ThreeFingerDragOnWindows/main/ThreeFingerDragOnWindows/Assets/Screenshot-3.png' alt="App screenshot: Other Settings tab" width='700'>
</p>

Expand Down
14 changes: 7 additions & 7 deletions ThreeFingerDragOnWindows/ThreeFingerDragOnWindows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="H.NotifyIcon.WinUI" Version="2.0.118" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231008000" />
<PackageReference Include="TaskScheduler" Version="2.10.1" />
<PackageReference Include="WinUICommunity.Components" Version="5.3.0" />
<PackageReference Include="WinUICommunity.Core" Version="5.3.1" />
<PackageReference Include="H.NotifyIcon.WinUI" Version="2.0.131" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240607001" />
<PackageReference Include="TaskScheduler" Version="2.11.0" />
<PackageReference Include="WinUICommunity.Components" Version="6.9.0" />
<PackageReference Include="WinUICommunity.Core" Version="6.9.0" />
<Manifest Include="$(ApplicationManifest)" />
<PackageReference Include="WinUICommunity.LandingPages" Version="5.3.1" />
<PackageReference Include="WinUICommunity.LandingPages" Version="6.9.0" />
</ItemGroup>

<!--
Expand Down
60 changes: 31 additions & 29 deletions ThreeFingerDragOnWindows/settings/OtherSettings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,35 +64,37 @@


<wuc:SettingsGroup Header="About">
<wuc:SettingsExpander Description="© 2023-2024. All rights reserved."
Header="ThreeFingerDragOnWindows">
<wuc:SettingsExpander.HeaderIcon>
<BitmapIcon ShowAsMonochrome="False"
UriSource="ms-appx:///Assets/icon-52.png" />
</wuc:SettingsExpander.HeaderIcon>

<TextBlock Foreground="{ThemeResource TextFillColorSecondaryBrush}"
IsTextSelectionEnabled="True"
Style="{StaticResource CaptionTextBlockStyle}"
Text="Version 2.0.4.0" />

<wuc:SettingsExpander.Items>
<wuc:SettingsCard HorizontalContentAlignment="Left"
ContentAlignment="Left">
<StackPanel Margin="-12,0,0,0"
Orientation="Vertical">
<HyperlinkButton Content="GitHub repository"
NavigateUri="https://github.com/ClementGre/ThreeFingerDragOnWindows"
Margin="0,0,0,5" />
<HyperlinkButton Content="Donate with Paypal"
NavigateUri="https://www.paypal.com/paypalme/themsou" />
</StackPanel>
</wuc:SettingsCard>
</wuc:SettingsExpander.Items>
</wuc:SettingsExpander>
<HyperlinkButton Margin="0,8,0,0"
Content="Open GitHub issue"
NavigateUri="https://github.com/ClementGre/ThreeFingerDragOnWindows/issues/new" />
<wuc:SettingsGroup.Items>
<wuc:SettingsExpander Description="© 2023-2024. All rights reserved."
Header="ThreeFingerDragOnWindows">
<wuc:SettingsExpander.HeaderIcon>
<BitmapIcon ShowAsMonochrome="False"
UriSource="ms-appx:///Assets/icon-52.png" />
</wuc:SettingsExpander.HeaderIcon>

<TextBlock Foreground="{ThemeResource TextFillColorSecondaryBrush}"
IsTextSelectionEnabled="True"
Style="{StaticResource CaptionTextBlockStyle}"
Text="Version 2.0.4.0" />

<wuc:SettingsExpander.Items>
<wuc:SettingsCard HorizontalContentAlignment="Left"
ContentAlignment="Left">
<StackPanel Margin="-12,0,0,0"
Orientation="Vertical">
<HyperlinkButton Content="GitHub repository"
NavigateUri="https://github.com/ClementGre/ThreeFingerDragOnWindows"
Margin="0,0,0,5" />
<HyperlinkButton Content="Donate with Paypal"
NavigateUri="https://www.paypal.com/paypalme/themsou" />
</StackPanel>
</wuc:SettingsCard>
</wuc:SettingsExpander.Items>
</wuc:SettingsExpander>
<HyperlinkButton Margin="0,8,0,0"
Content="Open GitHub issue"
NavigateUri="https://github.com/ClementGre/ThreeFingerDragOnWindows/issues/new" />
</wuc:SettingsGroup.Items>
</wuc:SettingsGroup>


Expand Down
10 changes: 5 additions & 5 deletions ThreeFingerDragOnWindows/settings/SettingsData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class SettingsData{
public static bool DidVersionChanged { get; set; } = false;
public int SettingsVersion { get; set; } = 0;

// Three fingers drag Settings
// Three finger drag Settings
public bool ThreeFingerDrag { get; set; } = true;

public bool ThreeFingerDragAllowReleaseAndRestart { get; set; } = true;
Expand Down Expand Up @@ -46,11 +46,11 @@ public enum StartupActionType{

public static SettingsData load(){
Logger.Log("Loading settings...");

var mySerializer = new XmlSerializer(typeof(SettingsData));
var myFileStream = new FileStream(getPath(true), FileMode.Open);
SettingsData up;

try{
up = (SettingsData)mySerializer.Deserialize(myFileStream);
myFileStream.Close();
Expand Down Expand Up @@ -80,7 +80,7 @@ public static SettingsData load(){
Logger.Log("SettingsWindow not ready, skipping v2.0.3 upgrade dialog");
return;
}

ContentDialog dialog = new ContentDialog{
XamlRoot = App.SettingsWindow.Content.XamlRoot,
Style = Application.Current.Resources["DefaultContentDialogStyle"] as Style,
Expand All @@ -92,7 +92,7 @@ public static SettingsData load(){
});
}
}

}

if(up.SettingsVersion != CURRENT_SETTINGS_VERSION){
Expand Down
18 changes: 9 additions & 9 deletions ThreeFingerDragOnWindows/settings/SettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace ThreeFingerDragOnWindows.settings;

public sealed partial class SettingsWindow {
private readonly App _app;

/*private void NumberValidationTextBox(object sender, TextCompositionEventArgs e)
{
var regex = new Regex("[^0-9]+");
Expand All @@ -33,7 +33,7 @@ public SettingsWindow(App app, bool openOtherSettings){

ExtendsContentIntoTitleBar = true; // enable custom titlebar
SetTitleBar(TitleBar); // set TitleBar element as titlebar

NavigationView.SelectedItem = openOtherSettings ? OtherSettings : Touchpad;
}

Expand All @@ -42,11 +42,11 @@ private void NavigationView_SelectionChanged(NavigationView sender, NavigationVi
if(e.SelectedItem.Equals(Touchpad)){
sender.Header = "Touchpad";
ContentFrame.Navigate(typeof(TouchpadSettings));

}if(e.SelectedItem.Equals(ThreeFingerDrag)){
sender.Header = "Three Fingers Drag";
sender.Header = "Three Finger Drag";
ContentFrame.Navigate(typeof(ThreeFingerDragSettings));

} else if(e.SelectedItem.Equals(OtherSettings)){
sender.Header = "Other Settings";
ContentFrame.Navigate(typeof(OtherSettings));
Expand All @@ -68,10 +68,10 @@ private void QuitButton_Click(object sender, RoutedEventArgs e){
private void Window_Closed(object sender, WindowEventArgs e){
Logger.Log("Hiding SettingsWindow, saving data...");
App.SettingsData.save();

// Navigate to another page, so the "OnNavigatedFrom()" of OtherSettings gets called (for the timer).
ContentFrame.Navigate(typeof(TouchpadSettings));

_app.OnClosePrefsWindow();
}

Expand All @@ -80,7 +80,7 @@ private void Window_Closed(object sender, WindowEventArgs e){
private long _lastEventSpeed;
public void OnTouchpadContact(TouchpadContact[] contacts, bool isSingleContactMode){
_inputCount++;

// Event speed is an average over 20 inputs calls (usually about 200 ms)
if(_inputCount >= 20){
_inputCount = 0;
Expand All @@ -102,4 +102,4 @@ public void OnTouchpadInitialized(){
private long Ctms(){
return new DateTimeOffset(DateTime.UtcNow).ToUnixTimeMilliseconds();
}
}
}
22 changes: 11 additions & 11 deletions ThreeFingerDragOnWindows/settings/ThreeFingerDragSettings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<StackPanel Margin="20,0,20,20"
ChildrenTransitions="{StaticResource SettingsCardsAnimations}"
Spacing="5">

<InfoBar
Title="The three finger drag might not work properly on this Settings window, but you can try it out on other windows!"
IsIconVisible="False"
Expand All @@ -23,7 +23,7 @@
Severity="Warning"/>

<wuc:SettingsCard
Description="Allows to select text, drag windows and other objects with three fingers on the touchpad (left click simulation)."
Description="Allows to select text, drag windows and other objects with three finger on the touchpad (left click simulation)."
HeaderIcon="{wuc:BitmapIcon Source='ms-appx:///Assets/icon-threefinger.png', ShowAsMonochrome=True}"
Header="Enable three finger drag">
<ToggleSwitch x:Name="Enabled"
Expand Down Expand Up @@ -53,7 +53,7 @@
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<Image Source="ms-appx:///Assets/TouchpadThreeFingerSettings.png"
Grid.Column="0"
VerticalAlignment="Top"/>
Expand Down Expand Up @@ -103,16 +103,16 @@
<wuc:SettingsCard Header="Mouse speed"
Description="Default to 30"
IsEnabled="{Binding ElementName=CursorMove, Path=IsOn}">

<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Spacing="10">
<Slider MinWidth="200"
StepFrequency="1"
Maximum="200"
Minimum="1"
Value="{x:Bind CursorSpeedProperty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

<NumberBox MinWidth="60"
Value="{x:Bind CursorSpeedProperty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Value="{x:Bind CursorSpeedProperty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Maximum="100000"
Minimum="0"
SmallChange="5"
Expand All @@ -129,9 +129,9 @@
Maximum="30"
Minimum="0"
Value="{x:Bind CursorAccelerationProperty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

<NumberBox MinWidth="60"
Value="{x:Bind CursorAccelerationProperty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Value="{x:Bind CursorAccelerationProperty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Minimum="0"
Maximum="1000"
SmallChange="5"
Expand All @@ -142,11 +142,11 @@
</wuc:SettingsExpander.Items>

</wuc:SettingsExpander>

<wuc:SettingsCard Description="Move the cursor based on an average of the last N inputs. Raise the value to smooth the cursor movement. Change this setting only if you are having issues as it will raise latency. Default to 1."
Header="Average cursor movement" >
<NumberBox MinWidth="60"
Value="{x:Bind CursorAveragingProperty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Value="{x:Bind CursorAveragingProperty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Minimum="1"
Maximum="10"
SmallChange="1"
Expand All @@ -157,4 +157,4 @@
</StackPanel>
</ScrollView>

</Page>
</Page>

0 comments on commit 7150780

Please sign in to comment.