@@ -52,12 +52,14 @@ private void OnClosing(object sender, CancelEventArgs e)
52
52
53
53
private void OnInitialized ( object sender , EventArgs e )
54
54
{
55
- // show notify icon when flowlauncher is hided
56
- InitializeNotifyIcon ( ) ;
55
+
57
56
}
58
57
59
58
private void OnLoaded ( object sender , RoutedEventArgs _ )
60
59
{
60
+ // show notify icon when flowlauncher is hidden
61
+ InitializeNotifyIcon ( ) ;
62
+
61
63
// todo is there a way to set blur only once?
62
64
ThemeManager . Instance . SetBlurForWindow ( ) ;
63
65
WindowsInteropHelper . DisableControlBox ( this ) ;
@@ -87,11 +89,17 @@ private void OnLoaded(object sender, RoutedEventArgs _)
87
89
} ;
88
90
_settings . PropertyChanged += ( o , e ) =>
89
91
{
90
- if ( e . PropertyName == nameof ( Settings . HideNotifyIcon ) )
92
+ switch ( e . PropertyName )
91
93
{
92
- _notifyIcon . Visible = ! _settings . HideNotifyIcon ;
94
+ case nameof ( Settings . HideNotifyIcon ) :
95
+ _notifyIcon . Visible = ! _settings . HideNotifyIcon ;
96
+ break ;
97
+ case nameof ( Settings . Language ) :
98
+ UpdateNotifyIconText ( ) ;
99
+ break ;
93
100
}
94
101
} ;
102
+
95
103
InitializePosition ( ) ;
96
104
}
97
105
@@ -103,6 +111,18 @@ private void InitializePosition()
103
111
_settings . WindowLeft = Left ;
104
112
}
105
113
114
+ private void UpdateNotifyIconText ( )
115
+ {
116
+ var menu = _notifyIcon . ContextMenuStrip ;
117
+ var open = menu . Items [ 0 ] ;
118
+ var setting = menu . Items [ 1 ] ;
119
+ var exit = menu . Items [ 2 ] ;
120
+
121
+ open . Text = InternationalizationManager . Instance . GetTranslation ( "iconTrayOpen" ) ;
122
+ setting . Text = InternationalizationManager . Instance . GetTranslation ( "iconTraySettings" ) ;
123
+ exit . Text = InternationalizationManager . Instance . GetTranslation ( "iconTrayExit" ) ;
124
+ }
125
+
106
126
private void InitializeNotifyIcon ( )
107
127
{
108
128
_notifyIcon = new NotifyIcon
@@ -179,7 +199,6 @@ private void OnPreviewMouseButtonDown(object sender, MouseButtonEventArgs e)
179
199
}
180
200
}
181
201
182
-
183
202
private void OnDrop ( object sender , DragEventArgs e )
184
203
{
185
204
if ( e . Data . GetDataPresent ( DataFormats . FileDrop ) )
@@ -294,7 +313,5 @@ private void OnTextChanged(object sender, TextChangedEventArgs e)
294
313
_viewModel . QueryTextCursorMovedToEnd = false ;
295
314
}
296
315
}
297
-
298
-
299
316
}
300
317
}
0 commit comments