From 6bc6b5912e108522e83447d63fe4cb896ca75be0 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 17 Mar 2019 09:09:13 +0000 Subject: [PATCH] ide: ToolBar sync now lazy (improves the speed of editor) git-svn-id: svn://ultimatepp.org/upp/trunk@12844 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/ide.h | 2 ++ uppsrc/ide/idewin.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index 630efcce0..9e1e2f638 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -1085,6 +1085,8 @@ public: void SetBar(); void SetMenuBar(); void SetToolBar(); + TimeCallback delayed_toolbar; + void UpdateFormat(CodeEditor& editor); void UpdateFormat(); diff --git a/uppsrc/ide/idewin.cpp b/uppsrc/ide/idewin.cpp index 06841a059..60aa908ac 100644 --- a/uppsrc/ide/idewin.cpp +++ b/uppsrc/ide/idewin.cpp @@ -386,7 +386,9 @@ Ide::Ide() DiffDlg::WhenHighlight = callback(sHighlightLine); editor.theide = this; - editor.WhenSel = THISBACK(SetToolBar); + editor.WhenSel << [=] { + delayed_toolbar.KillSet(150, [=] { SetToolBar(); }); + }; editormode = false;