From b9723113aea8bde029892c08233e55a781dfd512 Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Wed, 31 Aug 2022 00:28:41 +0200 Subject: [PATCH] indexing progress improvement --- uppsrc/ide/ide.cpp | 4 ++-- uppsrc/ide/ide.h | 6 +----- uppsrc/ide/idewin.cpp | 6 ++---- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/uppsrc/ide/ide.cpp b/uppsrc/ide/ide.cpp index f7eadce61..a3cb0c75e 100644 --- a/uppsrc/ide/ide.cpp +++ b/uppsrc/ide/ide.cpp @@ -676,10 +676,10 @@ void Ide::SyncClang() if(Indexer::IsRunning()) { IndexerProgress mi; mi.pos = Indexer::Progress(); - display.Set(MakeImage(mi)); + indeximage.SetImage(MakeImage(mi)); } else - display.Set(Image()); + indeximage.SetImage(Null); animate_phase = phase; } diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index 534793da7..4ebc48fd7 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -346,14 +346,10 @@ struct WebSearchTab : WithSetupWebSearchTabLayout { struct CursorInfoCtrl : Ctrl { String text; -// Color animate = Null; - Image img; void Paint(Draw& w) override; void Set(const String& s) { text = s; Refresh(); } - void Set(const Image& m) { if(!m.IsSame(img)) { img = m; Refresh(); }} -// void Animate(Color c) { if(animate != c) { animate = c; Refresh(); } } CursorInfoCtrl(); }; @@ -690,7 +686,7 @@ public: FrameTop bararea; CursorInfoCtrl display; - + ImageCtrl indeximage; byte hilite_scope; int hilite_bracket; diff --git a/uppsrc/ide/idewin.cpp b/uppsrc/ide/idewin.cpp index a248ff6e9..fd5d28c94 100644 --- a/uppsrc/ide/idewin.cpp +++ b/uppsrc/ide/idewin.cpp @@ -339,10 +339,6 @@ static void sHighlightLine(const String& path, Vector& hln, void CursorInfoCtrl::Paint(Draw& w) { Size sz = GetSize(); - if(!IsNull(img)) { - Size isz = img.GetSize(); - w.DrawImage(0, (sz.cy - isz.cy) / 2, img); - } Size tsz = GetTextSize(text, StdFont()); int x = sz.cx - tsz.cx; int y = (sz.cy - tsz.cy) / 2; @@ -638,6 +634,8 @@ Ide::Ide() SetupBars(); SetBar(); + editor.search.Add(indeximage.RightPos(DPI(1), DPI(16)).VSizePos()); + #ifdef PLATFORM_COCOA WhenDockMenu = [=](Bar& bar) { bar.Add("Open main package..", [=] {