ide: Response file support in GCC builder, CtrlLib: Fixed appearance of ProgressIndicator in some cases

git-svn-id: svn://ultimatepp.org/upp/trunk@14354 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2020-04-23 09:09:50 +00:00
parent 54c7026649
commit b7c4720006
6 changed files with 49 additions and 28 deletions

View file

@ -311,8 +311,8 @@ void *operator new[](size_t size, const std::nothrow_t&) noexcept { void *ptr =
void operator delete[](void *ptr, const std::nothrow_t&) noexcept { UPP::MemoryFree(ptr); }
#if defined(PLATFORM_WIN32) && defined(COMPILER_CLANG)
// this is temporary fix before llvm-mingw fixes weak references
// void __attribute__((__noreturn__)) std::__throw_bad_alloc (void) { throw bad_alloc(); }
// this is temporary fix before llvm-mingw fixes weak references
void __attribute__((__noreturn__)) std::__throw_bad_alloc (void) { throw bad_alloc(); }
#endif
#endif

View file

@ -545,8 +545,12 @@ void ChSynthetic(Image *button100x100, Color *text, bool macos)
ib[i][0] = AdjustColor(c, a[i]);
ibb[i][0] = Blend(SColorFace(), SColorPaper(), i * 255 / 7);
}
s.hchunk = MakeButton(roundness, Magnify(ib, 10, 1), DPI(1), ink);
s.hlook = MakeButton(roundness, Magnify(ibb, 10, 1), DPI(1), ink);
Image m = MakeButton(roundness, Magnify(ib, 10, 1), DPI(1), ink);
s.hchunk = m;
s.vchunk = RotateAntiClockwise(m);
m = MakeButton(roundness, Magnify(ibb, 10, 1), DPI(1), ink);
s.hlook = m;
s.vlook = RotateAntiClockwise(m);
s.bound = true;
s.nomargins = true;
}

View file

@ -13,11 +13,21 @@ CH_STYLE(ProgressIndicator, Style, StyleDefault)
nomargins = false;
}
Rect ProgressIndicator::GetMargins()
{
if(style->classic || percent || !IsNull(color))
return ChMargins(ViewEdge());
Size sz = GetSize();
Rect r = ChMargins(sz.cx > sz.cy ? style->hlook : style->vlook);
if(style->nomargins)
r.left = r.right = r.top = r.bottom = 0;
return r;
}
Size ProgressIndicator::GetMsz()
{
Size sz = GetSize();
Rect mg = ChMargins(style->classic || percent || !IsNull(color) ? EditFieldEdge()
: sz.cx > sz.cy ? style->hlook : style->vlook);
Rect mg = GetMargins();
sz.cx -= mg.left + mg.right;
sz.cy -= mg.top + mg.bottom;
return sz;
@ -38,8 +48,8 @@ void ProgressIndicator::Paint(Draw& w) {
}
}
if(style->classic || percent || !IsNull(color)) {
ChPaintEdge(w, sz, EditFieldEdge());
Rect mg = ChMargins(EditFieldEdge());
ChPaintEdge(w, sz, ViewEdge());
Rect mg = GetMargins();
sz -= Size(mg.left + mg.right, mg.top + mg.bottom);
Rect r1, r2, r3;
r1 = r2 = r3 = RectC(mg.left, mg.top, sz.cx, sz.cy);
@ -47,12 +57,10 @@ void ProgressIndicator::Paint(Draw& w) {
if(sz.cx > sz.cy) {
r1.right = r2.left = min(p, sz.cx) + mg.left + p0;
r3.right = mg.left + p0;
r3.bottom = r1.bottom;
}
else {
r2.bottom = r1.top = sz.cy - min(p, sz.cy) + mg.left + p0;
r3.bottom = mg.top + p0;
r3.right = r1.right;
r2.bottom = r1.top = sz.cy - min(p, sz.cy) + mg.top - p0;
r3.top = r3.bottom - p0;
}
w.DrawRect(r1, Nvl(color, SColorHighlight()));
w.DrawRect(r2, SColorPaper);
@ -72,23 +80,17 @@ void ProgressIndicator::Paint(Draw& w) {
w.End();
}
else {
if(sz.cy > sz.cx) {
ChPaint(w, sz, style->vlook);
Rect r = ChMargins(style->vlook);
if(style->nomargins)
r.left = r.right = r.top = r.bottom = 0;
w.Clip(r.left, r.top, sz.cx - r.left - r.right, sz.cy - r.top - r.bottom);
ChPaint(w, r.left, sz.cy - r.bottom - p - p0, sz.cx - r.left - r.right, p,
style->vchunk);
}
else {
Rect r = GetMargins();
if(sz.cx > sz.cy) {
ChPaint(w, sz, style->hlook);
Rect r = ChMargins(style->hlook);
if(style->nomargins)
r.left = r.right = r.top = r.bottom = 0;
w.Clip(r.left, r.top, sz.cx - r.left - r.right, sz.cy - r.top - r.bottom);
ChPaint(w, r.left + p0, r.top, p, sz.cy - r.top - r.bottom, style->hchunk);
}
else {
ChPaint(w, sz, style->vlook);
w.Clip(r.left, r.top, sz.cx - r.left - r.right, sz.cy - r.top - r.bottom);
ChPaint(w, r.left, sz.cy - r.bottom - p - p0, sz.cx - r.left - r.right, p, style->vchunk);
}
w.End();
}
}

View file

@ -18,6 +18,7 @@ protected:
const Style *style;
Color color;
Rect GetMargins();
Size GetMsz();
public:

View file

@ -2,7 +2,7 @@ uses
CtrlCore,
plugin/glew;
library(WIN32 (GCC | CLANG)) "glaux glu32 opengl32";
library(WIN32 (GCC | CLANG)) "glu32 opengl32";
pkg_config(LINUX | BSD) "gl glu";

View file

@ -129,7 +129,9 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
}
String cc = CmdLine(package, pkg);
if(IsVerbose())
cc << " -v";
if(HasFlag("WIN32")/* && HasFlag("MT")*/)
cc << " -mthreads";
if(HasFlag("DEBUG_MINIMAL"))
@ -478,7 +480,9 @@ bool GccBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
for(int i = 0; i < linkfile.GetCount(); i++)
if(GetFileTime(linkfile[i]) > targettime) {
Vector<String> lib;
String lnk = CompilerName();
String lnk;
if(IsVerbose())
lnk << " -v";
if(HasFlag("GCC32"))
lnk << " -m32";
if(HasFlag("DLL"))
@ -578,6 +582,16 @@ bool GccBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
PutConsole("Linking...");
bool error = false;
CustomStep(".pre-link", Null, error);
if(lnk.GetCount() < 8000)
lnk = CompilerName() + " " + lnk;
else {
String rn = CatAnyPath(outdir, "link");
PutVerbose("Generating response file: " << rn);
PutVerbose(lnk);
lnk.Replace("\\", "/");
SaveFile(rn, lnk);
lnk = CompilerName() + " @" + rn;
}
if(!error && Execute(lnk) == 0) {
CustomStep(".post-link", Null, error);
PutConsole(String().Cat() << GetHostPath(target) << " (" << GetFileInfo(target).length