11using SecondaryClick . Gestures ;
2+ using SecondaryClick . Gestures . Modifiers ;
23using SecondaryClick . Gestures . Touchpads ;
34using SecondaryClick . WinApi ;
45using System . Diagnostics ;
@@ -49,7 +50,6 @@ private TrayIconManager()
4950 {
5051 _recognizerHolder = new ( ) ;
5152 _isTrayIconHidden = Configurations . HideTrayIcon . Get ( ) ;
52- ApplyModifierConfiguration ( ) ;
5353
5454 _icon = new TrayIconHost
5555 {
@@ -117,45 +117,45 @@ private TrayIconManager()
117117 Tag = nameof ( SH . ModifiersOff ) ,
118118 Header = SH . ModifiersOff ,
119119 IsChecked = false ,
120- Command = static _ =>
120+ Command = _ =>
121121 {
122122 Configurations . ModifiersAlt . Set ( false ) ;
123123 Configurations . ModifiersControl . Set ( false ) ;
124124 Configurations . ModifiersShift . Set ( false ) ;
125- GetInstance ( ) . ApplyModifierConfiguration ( ) ;
125+ ApplyModifierConfiguration ( ) ;
126126 } ,
127127 } ,
128128 new TrayMenuItem
129129 {
130130 Tag = nameof ( SH . ModifiersAlt ) ,
131131 Header = SH . ModifiersAlt ,
132132 IsChecked = Configurations . ModifiersAlt . Get ( ) ,
133- Command = static _ =>
133+ Command = _ =>
134134 {
135135 Configurations . ModifiersAlt . Set ( ! Configurations . ModifiersAlt . Get ( ) ) ;
136- GetInstance ( ) . ApplyModifierConfiguration ( ) ;
136+ ApplyModifierConfiguration ( ) ;
137137 } ,
138138 } ,
139139 new TrayMenuItem
140140 {
141141 Tag = nameof ( SH . ModifiersControl ) ,
142142 Header = SH . ModifiersControl ,
143143 IsChecked = Configurations . ModifiersControl . Get ( ) ,
144- Command = static _ =>
144+ Command = _ =>
145145 {
146146 Configurations . ModifiersControl . Set ( ! Configurations . ModifiersControl . Get ( ) ) ;
147- GetInstance ( ) . ApplyModifierConfiguration ( ) ;
147+ ApplyModifierConfiguration ( ) ;
148148 } ,
149149 } ,
150150 new TrayMenuItem
151151 {
152152 Tag = nameof ( SH . ModifiersShift ) ,
153153 Header = SH . ModifiersShift ,
154154 IsChecked = Configurations . ModifiersShift . Get ( ) ,
155- Command = static _ =>
155+ Command = _ =>
156156 {
157157 Configurations . ModifiersShift . Set ( ! Configurations . ModifiersShift . Get ( ) ) ;
158- GetInstance ( ) . ApplyModifierConfiguration ( ) ;
158+ ApplyModifierConfiguration ( ) ;
159159 } ,
160160 } ,
161161 ]
@@ -237,6 +237,8 @@ private TrayIconManager()
237237 } ;
238238 _trayIconVisibilityWatcher . Tick += OnTrayIconVisibilityWatcherTick ;
239239 _trayIconVisibilityWatcher . Start ( ) ;
240+
241+ ApplyModifierConfiguration ( ) ;
240242 }
241243
242244 private void ApplyTrayIconVisibilityFromConfiguration ( )
@@ -247,27 +249,25 @@ private void ApplyTrayIconVisibilityFromConfiguration()
247249
248250 private void ApplyModifierConfiguration ( )
249251 {
250- Gestures . Modifiers . GestureModifiers activationModifiers = Gestures . Modifiers . GestureModifiers . None ;
252+ GestureModifiers activationModifiers = GestureModifiers . None ;
251253
252254 if ( Configurations . ModifiersAlt . Get ( ) )
253255 {
254- activationModifiers |= Gestures . Modifiers . GestureModifiers . Alt ;
256+ activationModifiers |= GestureModifiers . Alt ;
255257 }
256258
257259 if ( Configurations . ModifiersControl . Get ( ) )
258260 {
259- activationModifiers |= Gestures . Modifiers . GestureModifiers . Control ;
261+ activationModifiers |= GestureModifiers . Control ;
260262 }
261263
262264 if ( Configurations . ModifiersShift . Get ( ) )
263265 {
264- activationModifiers |= Gestures . Modifiers . GestureModifiers . Shift ;
266+ activationModifiers |= GestureModifiers . Shift ;
265267 }
266268
267269 _recognizerHolder . ModifiersRecognizer . ActivationModifiers = activationModifiers ;
268- _recognizerHolder . ModifiersRecognizer . SetEnabled (
269- activationModifiers != Gestures . Modifiers . GestureModifiers . None
270- ) ;
270+ _recognizerHolder . ModifiersRecognizer . SetEnabled ( enabled : activationModifiers != GestureModifiers . None ) ;
271271 }
272272
273273 private void OnTrayIconVisibilityWatcherTick ( object ? sender , EventArgs e )
0 commit comments