ENH: webview dark mode

Change-Id: I0b58e759268d057d5942dd8726c37d1abbdd5930
This commit is contained in:
chunmao.guo 2022-11-11 09:48:51 +08:00 committed by Lane.Wei
parent 65ee16f676
commit bf24a71b60
7 changed files with 87 additions and 10 deletions

View file

@ -81,6 +81,16 @@ MarkdownTip::MarkdownTip()
_timer = new wxTimer;
_timer->Bind(wxEVT_TIMER, &MarkdownTip::OnTimer, this);
Bind(EVT_WEBVIEW_RECREATED, [this](auto &evt) {
Hide();
_lastTip.clear();
#ifdef __WXMSW__
_tipView = dynamic_cast<wxWebView *>(evt.GetEventObject());
GetSizer()->Add(_tipView, wxSizerFlags().Expand().Proportion(1));
Layout();
#endif
});
}
MarkdownTip::~MarkdownTip() { delete _timer; }