@@ -43,40 +43,40 @@ public SensorNotifyIcon(SystemTray sensorSystemTray, ISensor sensor, PersistentS
4343 Color = settings . GetValue ( new Identifier ( sensor . Identifier , "traycolor" ) . ToString ( ) , defaultColor ) ;
4444
4545 _pen = new Pen ( Color . FromArgb ( 96 , Color . Black ) ) ;
46- var contextMenuStrip = new ContextMenu ( ) ;
47- var hideShowItem = new MenuItem ( "Hide/Show" ) { DefaultItem = true } ;
46+ var contextMenuStrip = new ContextMenuStrip ( ) ;
47+ contextMenuStrip . Renderer = new ThemedToolStripRenderer ( ) ;
48+ var hideShowItem = new ToolStripMenuItem ( "Hide/Show" ) ;
4849 hideShowItem . Click += delegate
4950 {
5051 sensorSystemTray . SendHideShowCommand ( ) ;
5152 } ;
52- contextMenuStrip . MenuItems . Add ( hideShowItem ) ;
53- contextMenuStrip . MenuItems . Add ( "-" ) ;
54- var removeItem = new MenuItem ( "Remove Sensor" ) ;
53+ contextMenuStrip . Items . Add ( hideShowItem ) ;
54+ contextMenuStrip . Items . Add ( "-" ) ;
55+ var removeItem = new ToolStripMenuItem ( "Remove Sensor" ) ;
5556 removeItem . Click += delegate
5657 {
5758 sensorSystemTray . Remove ( Sensor ) ;
5859 } ;
59- contextMenuStrip . MenuItems . Add ( removeItem ) ;
60- var colorItem = new MenuItem ( "Change Color..." ) ;
60+ contextMenuStrip . Items . Add ( removeItem ) ;
61+ var colorItem = new ToolStripMenuItem ( "Change Color..." ) ;
6162 colorItem . Click += delegate
6263 {
6364 ColorDialog dialog = new ColorDialog { Color = Color } ;
6465 if ( dialog . ShowDialog ( ) == DialogResult . OK )
6566 {
6667 Color = dialog . Color ;
67- settings . SetValue ( new Identifier ( sensor . Identifier ,
68- "traycolor" ) . ToString ( ) , Color ) ;
68+ settings . SetValue ( new Identifier ( sensor . Identifier , "traycolor" ) . ToString ( ) , Color ) ;
6969 }
7070 } ;
71- contextMenuStrip . MenuItems . Add ( colorItem ) ;
72- contextMenuStrip . MenuItems . Add ( "-" ) ;
73- var exitItem = new MenuItem ( "Exit" ) ;
71+ contextMenuStrip . Items . Add ( colorItem ) ;
72+ contextMenuStrip . Items . Add ( "-" ) ;
73+ var exitItem = new ToolStripMenuItem ( "Exit" ) ;
7474 exitItem . Click += delegate
7575 {
7676 sensorSystemTray . SendExitCommand ( ) ;
7777 } ;
78- contextMenuStrip . MenuItems . Add ( exitItem ) ;
79- _notifyIcon . ContextMenu = contextMenuStrip ;
78+ contextMenuStrip . Items . Add ( exitItem ) ;
79+ _notifyIcon . ContextMenuStrip = contextMenuStrip ;
8080 _notifyIcon . DoubleClick += delegate
8181 {
8282 sensorSystemTray . SendHideShowCommand ( ) ;
0 commit comments