From 123f66b30093f18ffccefa88270ac115d8c28c7e Mon Sep 17 00:00:00 2001 From: "adrian.hajdukiewicz" Date: Wed, 15 Feb 2023 22:59:30 +0100 Subject: [PATCH 1/3] fix: update NET framework version from 4.5 to 4.5.1 to make the compilation work --- src/HuntAndPeck/App.config | 2 +- src/HuntAndPeck/HuntAndPeck.csproj | 6 +++--- src/NativeMethods/NativeMethods.csproj | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/HuntAndPeck/App.config b/src/HuntAndPeck/App.config index 8e15646..9c05822 100644 --- a/src/HuntAndPeck/App.config +++ b/src/HuntAndPeck/App.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/HuntAndPeck/HuntAndPeck.csproj b/src/HuntAndPeck/HuntAndPeck.csproj index 8c6d63c..309652b 100644 --- a/src/HuntAndPeck/HuntAndPeck.csproj +++ b/src/HuntAndPeck/HuntAndPeck.csproj @@ -9,7 +9,7 @@ Properties HuntAndPeck hap - v4.5 + v4.5.1 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 @@ -184,9 +184,9 @@ - + False - Microsoft .NET Framework 4.5 %28x86 and x64%29 + Microsoft .NET Framework 4.5.1 %28x86 and x64%29 true diff --git a/src/NativeMethods/NativeMethods.csproj b/src/NativeMethods/NativeMethods.csproj index 344aa91..4a22972 100644 --- a/src/NativeMethods/NativeMethods.csproj +++ b/src/NativeMethods/NativeMethods.csproj @@ -9,7 +9,7 @@ Properties HuntAndPeck.NativeMethods HuntAndPeck.NativeMethods - v4.5 + v4.5.1 512 ..\ true From 05619c341f46d176841f8af8751deda5207c0359 Mon Sep 17 00:00:00 2001 From: "adrian.hajdukiewicz1" Date: Thu, 16 Feb 2023 11:48:20 +0100 Subject: [PATCH 2/3] feat: add option to change font size in the tray menu --- .../Properties/Settings.Designer.cs | 21 ++++++-- src/HuntAndPeck/Properties/Settings.settings | 8 ++- src/HuntAndPeck/ViewModels/HintViewModel.cs | 9 ++++ .../ViewModels/OptionsViewModel.cs | 50 +++++++++++++++++-- src/HuntAndPeck/Views/OptionsView.xaml | 26 ++++++++++ src/HuntAndPeck/Views/OverlayView.xaml | 2 +- 6 files changed, 106 insertions(+), 10 deletions(-) diff --git a/src/HuntAndPeck/Properties/Settings.Designer.cs b/src/HuntAndPeck/Properties/Settings.Designer.cs index 315e965..6851301 100644 --- a/src/HuntAndPeck/Properties/Settings.Designer.cs +++ b/src/HuntAndPeck/Properties/Settings.Designer.cs @@ -9,18 +9,31 @@ //------------------------------------------------------------------------------ namespace HuntAndPeck.Properties { - - + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - + public static Settings Default { get { return defaultInstance; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("14")] + public string FontSize { + get { + return ((string)(this["FontSize"])); + } + set { + this["FontSize"] = value; + } + } + } } diff --git a/src/HuntAndPeck/Properties/Settings.settings b/src/HuntAndPeck/Properties/Settings.settings index 033d7a5..538a10e 100644 --- a/src/HuntAndPeck/Properties/Settings.settings +++ b/src/HuntAndPeck/Properties/Settings.settings @@ -3,5 +3,9 @@ - - \ No newline at end of file + + + 14 + + + diff --git a/src/HuntAndPeck/ViewModels/HintViewModel.cs b/src/HuntAndPeck/ViewModels/HintViewModel.cs index a592f2a..fe1fe64 100644 --- a/src/HuntAndPeck/ViewModels/HintViewModel.cs +++ b/src/HuntAndPeck/ViewModels/HintViewModel.cs @@ -1,4 +1,5 @@ using HuntAndPeck.Models; +using HuntAndPeck.Properties; namespace HuntAndPeck.ViewModels { @@ -6,10 +7,12 @@ public class HintViewModel : NotifyPropertyChanged { private string _label; private bool _active; + private string _fontSizeReadValue; public HintViewModel(Hint hint) { Hint = hint; + FontSizeReadValue = Settings.Default.FontSize; } public Hint Hint { get; set; } @@ -25,5 +28,11 @@ public string Label get { return _label; } set { _label = value; NotifyOfPropertyChange(); } } + + public string FontSizeReadValue + { + get { return _fontSizeReadValue; } + set { _fontSizeReadValue = value; NotifyOfPropertyChange(); } + } } } diff --git a/src/HuntAndPeck/ViewModels/OptionsViewModel.cs b/src/HuntAndPeck/ViewModels/OptionsViewModel.cs index e23dd17..60eff42 100644 --- a/src/HuntAndPeck/ViewModels/OptionsViewModel.cs +++ b/src/HuntAndPeck/ViewModels/OptionsViewModel.cs @@ -1,12 +1,56 @@ -namespace HuntAndPeck.ViewModels +using HuntAndPeck.Properties; +using System; +using System.ComponentModel; +using System.Windows; + +namespace HuntAndPeck.ViewModels { - internal class OptionsViewModel + internal class OptionsViewModel : INotifyPropertyChanged { public OptionsViewModel() { DisplayName = "Options"; + FontSize = Settings.Default.FontSize; + Settings.Default.PropertyChanged += OnSettingsPropertyChanged; } public string DisplayName { get; set; } + + private string _fontSize; + public string FontSize + // Assign the font size value to a variable and update it every time user + // changes the option in tray menu + { + get { return _fontSize; } + set + { + if (_fontSize != value) + { + _fontSize = value; + OnPropertyChanged("FontSize"); + Settings.Default.FontSize = value; + Settings.Default.Save(); + } + } + } + + + private void OnSettingsPropertyChanged(object sender, PropertyChangedEventArgs e) + { + if (e.PropertyName == "FontSize") + { + FontSize = Settings.Default.FontSize; + } + } + + public event PropertyChangedEventHandler PropertyChanged; + + private void OnPropertyChanged(string propertyName) + { + if (PropertyChanged != null) + { + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } } -} +} \ No newline at end of file diff --git a/src/HuntAndPeck/Views/OptionsView.xaml b/src/HuntAndPeck/Views/OptionsView.xaml index 3a30617..a1b6ce7 100644 --- a/src/HuntAndPeck/Views/OptionsView.xaml +++ b/src/HuntAndPeck/Views/OptionsView.xaml @@ -22,5 +22,31 @@ + + + + + + diff --git a/src/HuntAndPeck/Views/OverlayView.xaml b/src/HuntAndPeck/Views/OverlayView.xaml index 26e3a0f..3269be8 100644 --- a/src/HuntAndPeck/Views/OverlayView.xaml +++ b/src/HuntAndPeck/Views/OverlayView.xaml @@ -49,7 +49,7 @@ --> - + From d1ce315ed1c15dd005139fcd7cacfbdb1f6b4b9d Mon Sep 17 00:00:00 2001 From: "adrian.hajdukiewicz1" Date: Thu, 16 Feb 2023 12:07:40 +0100 Subject: [PATCH 3/3] docs: add info on changing font size to readme; Ref #36 --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 71444e3..ef73ff7 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,10 @@ NOTE: hunt-n-peck is no longer maintained, please consider one of the various fo https://github.com/zsims/hunt-and-peck/releases/download/release%2F1.6/HuntAndPeck-1.6.zip +# How to change font size + +Find the application icon in tray, click right mouse button, select `Options`, then use the `FontSize` menu to change the font size. + # Screenshots ![ScreenShot](https://raw.github.com/zsims/hunt-n-peck/master/screenshots/explorer.png)