From bd76e60e2fc4540c3e7bcbc0de5c7418cb5ca6e9 Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 4 Sep 2018 11:39:06 +0000 Subject: [PATCH] upp.src: UHD tweaks git-svn-id: svn://ultimatepp.org/upp/trunk@12244 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Draw/Uhd.cpp | 2 +- uppsrc/Draw/src.tpp/UHD_en-us.tpp | 6 ++++-- uppsrc/ide/About.cpp | 5 +++++ uppsrc/ide/SelectPkg.cpp | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/uppsrc/Draw/Uhd.cpp b/uppsrc/Draw/Uhd.cpp index 5af559f69..34da9c0a7 100644 --- a/uppsrc/Draw/Uhd.cpp +++ b/uppsrc/Draw/Uhd.cpp @@ -107,7 +107,7 @@ bool IsUHDMode() void SyncUHDMode() { - bool uhd = GetStdFontCy() > 22; + bool uhd = GetStdFontCy() > 27; if(uhd != IsUHDMode()) SetUHDMode(uhd); } diff --git a/uppsrc/Draw/src.tpp/UHD_en-us.tpp b/uppsrc/Draw/src.tpp/UHD_en-us.tpp index 67c2e3ba3..dd0e3c891 100644 --- a/uppsrc/Draw/src.tpp/UHD_en-us.tpp +++ b/uppsrc/Draw/src.tpp/UHD_en-us.tpp @@ -1,5 +1,4 @@ topic "Ultra High Definition Displays support"; -[2 $$0,0#00000000000000000000000000000000:Default] [i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class] [l288;2 $$2,2#27521748481378242620020725143825:desc] [0 $$3,0#96390100711032703541132217272105:end] @@ -9,6 +8,7 @@ topic "Ultra High Definition Displays support"; [l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param] [i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam] [b42;2 $$9,9#13035079074754324216151401829390:normal] +[2 $$0,0#00000000000000000000000000000000:Default] [{_} [ {{10000@(113.42.0) [s0;%% [*@7;4 Ultra High Definition Displays support]]}}&] [s0;i448;a25;kKO9;@(0.0.255) &] @@ -23,7 +23,9 @@ topic "Ultra High Definition Displays support"; [s3; &] [s4; &] [s5;:Upp`:`:SyncUHDMode`(`): [@(0.0.255) void]_[* SyncUHDMode]()&] -[s2;%% Sets the UHD mode if current GUI font is bigger than 22 pixels.&] +[s2;%% Sets the UHD mode if current GUI font is bigger than 27 pixels +(in windows, that corresponds to text size bigger than approximately +160%).&] [s3; &] [s4; &] [s5;:Upp`:`:DPI`(const Upp`:`:Image`&`): [_^Upp`:`:Image^ Image]_[* DPI]([@(0.0.255) const]_ diff --git a/uppsrc/ide/About.cpp b/uppsrc/ide/About.cpp index 1933e1899..ed6216928 100644 --- a/uppsrc/ide/About.cpp +++ b/uppsrc/ide/About.cpp @@ -34,6 +34,9 @@ String SplashCtrl::GenerateVersionInfo(char separator) #if __cplusplus >= 201100 h << " (C++11)"; #endif +#if __cplusplus >= 201400 + h << " (C++14)"; +#endif #ifdef GUI_GTK h << " (Gtk)"; #endif @@ -71,6 +74,8 @@ Size SplashCtrl::MakeLogo(Ctrl& parent, Array& ctrl) h << "Using: " << MemoryUsedKb() << " KB\n"; if(cpp.GetCount()) h << "CodeBase: " << cpp.GetCount() << " classes, " << total << " items\n"; + if(IsUHDMode()) + h << "UHD mode\n"; v1 = h; v1.HSizePos(DPI(220), DPI(10)).BottomPos(DPI(20), Arial(DPI(20)).GetHeight() * 5); v1.SetFont(Arial(DPI(10))); diff --git a/uppsrc/ide/SelectPkg.cpp b/uppsrc/ide/SelectPkg.cpp index 06c722b92..d55373220 100644 --- a/uppsrc/ide/SelectPkg.cpp +++ b/uppsrc/ide/SelectPkg.cpp @@ -411,7 +411,7 @@ struct PackageDisplay : Display { icon = DPI(icon, 16); w.DrawRect(r, paper); w.DrawImage(r.left, r.top + (r.Height() - icon.GetHeight()) / 2, icon); - w.DrawText(r.left + Zx(20), r.top + (r.Height() - Draw::GetStdFontCy()) / 2, txt, fnt, ink); + w.DrawText(r.left + DPI(20), r.top + (r.Height() - Draw::GetStdFontCy()) / 2, txt, fnt, ink); } PackageDisplay() { fnt = StdFont(); } @@ -452,7 +452,7 @@ void SelectPackageDlg::SyncList(const String& find) Image icon = pkg.icon; if(IsNull(icon)) icon = pkg.main ? IdeImg::MainPackage() : IdeImg::Package(); - clist.Add(pkg.package, icon); + clist.Add(pkg.package, DPI(icon, 16)); alist.Add(pkg.package, pkg.nest, pkg.description, icon); alist.SetDisplay(alist.GetCount() - 1, 0, pkg.main ? bpd : pd); }