88using System . Runtime . InteropServices ;
99using ScintillaNet ;
1010using PluginCore . BBCode ;
11+ using PluginCore . Managers ;
1112
1213
1314namespace PluginCore . Controls
1415{
1516 /// <summary>
1617 /// RichTextBox-based tooltip
1718 /// </summary>
18- public class RichToolTip
19+ public class RichToolTip : IEventHandler
1920 {
2021 public delegate void UpdateTipHandler ( ScintillaControl sender , Point mousePosition ) ;
2122
@@ -66,6 +67,7 @@ public string Text
6667
6768 public RichToolTip ( IMainForm mainForm )
6869 {
70+ EventManager . AddEventHandler ( this , EventType . ApplyTheme ) ;
6971 // panel
7072 toolTip = new Panel ( ) ;
7173 toolTip . Location = new System . Drawing . Point ( 0 , 0 ) ;
@@ -92,7 +94,21 @@ public RichToolTip(IMainForm mainForm)
9294 rtfCache = new Dictionary < String , String > ( ) ;
9395 rtfCacheList = new List < String > ( ) ;
9496 }
95-
97+
98+
99+ public void HandleEvent ( Object sender , NotifyEvent e , HandlingPriority priority )
100+ {
101+ if ( e . Type == EventType . ApplyTheme )
102+ {
103+ Color fore = PluginBase . MainForm . GetThemeColor ( "RichToolTip.ForeColor" ) ;
104+ Color back = PluginBase . MainForm . GetThemeColor ( "RichToolTip.BackColor" ) ;
105+ toolTip . BackColor = back == Color . Empty ? System . Drawing . SystemColors . Info : back ;
106+ toolTip . ForeColor = fore == Color . Empty ? System . Drawing . SystemColors . InfoText : fore ;
107+ toolTipRTB . ForeColor = fore == Color . Empty ? System . Drawing . SystemColors . InfoText : fore ;
108+ toolTipRTB . BackColor = back == Color . Empty ? System . Drawing . SystemColors . Info : back ;
109+ }
110+ }
111+
96112 #endregion
97113
98114 #region Tip Methods
0 commit comments