diff --git a/src/App.config b/src/App.config index 12a0b6d..2abc67e 100644 --- a/src/App.config +++ b/src/App.config @@ -34,9 +34,24 @@ 5 - - True + + 5 + + True + + + True + + + True + + + True + + + True + \ No newline at end of file diff --git a/src/MainModel.cs b/src/MainModel.cs index de5fc25..1d5cf10 100644 --- a/src/MainModel.cs +++ b/src/MainModel.cs @@ -92,6 +92,16 @@ public int EdgeTolerance } } + public int CornerTolerance + { + get => Properties.Settings.Default.CornerTolerance; + set + { + Properties.Settings.Default.CornerTolerance = value; + Properties.Settings.Default.Save(); + } + } + public bool EnableCtrlMute { get => Properties.Settings.Default.EnableCtrlMute; @@ -102,6 +112,46 @@ public bool EnableCtrlMute } } + public bool EnableTopEdge + { + get => Properties.Settings.Default.EnableTopEdge; + set + { + Properties.Settings.Default.EnableTopEdge = value; + Properties.Settings.Default.Save(); + } + } + + public bool EnableRightEdge + { + get => Properties.Settings.Default.EnableRightEdge; + set + { + Properties.Settings.Default.EnableRightEdge = value; + Properties.Settings.Default.Save(); + } + } + + public bool EnableBottomEdge + { + get => Properties.Settings.Default.EnableBottomEdge; + set + { + Properties.Settings.Default.EnableBottomEdge = value; + Properties.Settings.Default.Save(); + } + } + + public bool EnableLeftEdge + { + get => Properties.Settings.Default.EnableLeftEdge; + set + { + Properties.Settings.Default.EnableLeftEdge = value; + Properties.Settings.Default.Save(); + } + } + public static string TaskBarIconPath => GetTaskbarIconPath(); private static string GetTaskbarIconPath() diff --git a/src/MainViewModel.cs b/src/MainViewModel.cs index bdaef01..d78001e 100644 --- a/src/MainViewModel.cs +++ b/src/MainViewModel.cs @@ -38,6 +38,7 @@ public TriggerMode Mode { mainModel.Mode = value; OnPropertyChanged(); + OnPropertyChanged(nameof(IsCornersModeSelected)); OnPropertyChanged(nameof(IsEdgesModeSelected)); } } @@ -56,6 +57,8 @@ public bool EnableTopLeft } } + public bool IsCornersModeSelected => Mode == TriggerMode.ScreenCorners; + public bool IsEdgesModeSelected => Mode == TriggerMode.ScreenEdges; public bool EnableTopRight @@ -110,6 +113,19 @@ public int EdgeTolerance } } + public int CornerTolerance + { + get => mainModel.CornerTolerance; + set + { + if (mainModel.CornerTolerance != value) + { + mainModel.CornerTolerance = value; + OnPropertyChanged(); + } + } + } + public bool EnableCtrlMute { get => mainModel.EnableCtrlMute; @@ -123,6 +139,58 @@ public bool EnableCtrlMute } } + public bool EnableTopEdge + { + get => mainModel.EnableTopEdge; + set + { + if (mainModel.EnableTopEdge != value) + { + mainModel.EnableTopEdge = value; + OnPropertyChanged(); + } + } + } + + public bool EnableRightEdge + { + get => mainModel.EnableRightEdge; + set + { + if (mainModel.EnableRightEdge != value) + { + mainModel.EnableRightEdge = value; + OnPropertyChanged(); + } + } + } + + public bool EnableBottomEdge + { + get => mainModel.EnableBottomEdge; + set + { + if (mainModel.EnableBottomEdge != value) + { + mainModel.EnableBottomEdge = value; + OnPropertyChanged(); + } + } + } + + public bool EnableLeftEdge + { + get => mainModel.EnableLeftEdge; + set + { + if (mainModel.EnableLeftEdge != value) + { + mainModel.EnableLeftEdge = value; + OnPropertyChanged(); + } + } + } + public void Dispose() { SystemEvents.UserPreferenceChanged -= UserPreferenceChanged; diff --git a/src/MainWindow.xaml b/src/MainWindow.xaml index 5d5e5c0..9dbe112 100644 --- a/src/MainWindow.xaml +++ b/src/MainWindow.xaml @@ -30,17 +30,14 @@ - - - - - - - - - - - + + + + + + + + @@ -108,19 +105,24 @@ Margin="0,3,0,3" IsChecked="{Binding Mode, ConverterParameter=TaskbarAlways, Converter={StaticResource EnumBooleanConverter}}" GroupName="TriggerMode" /> - + + + - + + Visibility="{Binding IsCornersModeSelected, Converter={StaticResource BooleanToVisibilityConverter}}"> - - + - - - + + @@ -212,9 +214,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +