From 116342183cb02f1214cab810ae9a3322f325e975 Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 9 Mar 2019 07:47:38 +0000 Subject: [PATCH] ide: Presentation margins, Core: more diag in CoWork git-svn-id: svn://ultimatepp.org/upp/trunk@12818 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/CoWork.cpp | 3 +++ uppsrc/ide/Help.cpp | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/uppsrc/Core/CoWork.cpp b/uppsrc/Core/CoWork.cpp index 3124ac508..d07f63017 100644 --- a/uppsrc/Core/CoWork.cpp +++ b/uppsrc/Core/CoWork.cpp @@ -7,6 +7,7 @@ namespace Upp { #define LLOG(x) // RLOG(x) #define LDUMP(x) // DDUMP(x) +#define LTIMING(x) // RTIMING(x) #define LHITCOUNT(x) // RHITCOUNT(x) thread_local bool CoWork::Pool::finlock; @@ -164,6 +165,7 @@ void CoWork::Pool::PushJob(Function&& fn, CoWork *work, bool looper) job.looper = looper; LLOG("Adding job"); if(waiting_threads) { + LTIMING("Releasing thread waiting for job"); LLOG("Releasing thread waiting for job, waiting threads: " << waiting_threads); waitforjob.Signal(); } @@ -186,6 +188,7 @@ void CoWork::Schedule(Function&& fn) void CoWork::Do0(Function&& fn, bool looper) { + LTIMING("Scheduling callback"); LHITCOUNT("CoWork: Scheduling callback"); LLOG("Do0, looper: " << looper << ", previous todo: " << todo); Pool& p = GetPool(); diff --git a/uppsrc/ide/Help.cpp b/uppsrc/ide/Help.cpp index 407c29fb0..97500ac33 100644 --- a/uppsrc/ide/Help.cpp +++ b/uppsrc/ide/Help.cpp @@ -380,7 +380,10 @@ struct SlideShow : TopWindow { Vector path; int page; int rp; + int zoom = 4; + int margins = 1; + bool vcenter = true; void SetPage(); @@ -402,6 +405,12 @@ bool SlideShow::Key(dword key, int count) case K_PAGEDOWN: page++; break; + case K_ALT|K_ADD: + margins = min(margins + 1, 100); + break; + case K_ALT|K_SUBTRACT: + margins = max(margins - 1, 0); + break; case K_CTRL|K_ADD: zoom = min(zoom + 1, 20); break; @@ -418,6 +427,8 @@ bool SlideShow::Key(dword key, int count) void SlideShow::SetPage() { text.SetZoom(Zoom(DPI(zoom), 20)); + text.VCenter(vcenter); + text.Margins(8 * margins); page = minmax(page, 0, path.GetCount() - 1); if(page != rp) { rp = page; @@ -431,8 +442,6 @@ SlideShow::SlideShow() Add(text.SizePos()); text.NoHyperlinkDecoration(); text.NoSb(); - text.VCenter(); - text.Margins(8); rp = -1; }