ide: Presentation margins, Core: more diag in CoWork

git-svn-id: svn://ultimatepp.org/upp/trunk@12818 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-03-09 07:47:38 +00:00
parent 590a04160b
commit 116342183c
2 changed files with 14 additions and 2 deletions

View file

@ -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<void ()>&& 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<void ()>&& fn)
void CoWork::Do0(Function<void ()>&& fn, bool looper)
{
LTIMING("Scheduling callback");
LHITCOUNT("CoWork: Scheduling callback");
LLOG("Do0, looper: " << looper << ", previous todo: " << todo);
Pool& p = GetPool();

View file

@ -380,7 +380,10 @@ struct SlideShow : TopWindow {
Vector<String> 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;
}