diff --git a/uppsrc/CtrlCore/ToDo.txt b/uppsrc/CtrlCore/ToDo.txt index c71c97fde..75946d305 100644 --- a/uppsrc/CtrlCore/ToDo.txt +++ b/uppsrc/CtrlCore/ToDo.txt @@ -4,6 +4,10 @@ - Make allocator work - FileChooser - InsetFrame vs DefaultFrame +- MacOS crash when addint Label to TestChStyles +- Ide: When dark editor in light theme, svn history is invisible (as text is white) +- LayDes .usc: Small defect in slider thumb in SD mode +- Laydes Rect is still to aggresive NTH: diff --git a/uppsrc/CtrlLib/Ch.cpp b/uppsrc/CtrlLib/Ch.cpp index 9b30f5da0..c215546ff 100644 --- a/uppsrc/CtrlLib/Ch.cpp +++ b/uppsrc/CtrlLib/Ch.cpp @@ -450,7 +450,7 @@ void ChSynthetic(Image *button100x100, Color *text, bool macos) s.left[i] = MakeButton(roundness, m2, lw, ink, CORNER_TOP_LEFT|CORNER_BOTTOM_LEFT); s.trivial[i] = s.look[i] = s.right[i] = MakeButton(roundness, m2, lw, ink, CORNER_TOP_RIGHT|CORNER_BOTTOM_RIGHT); if(i == 0) - s.coloredge = WithHotSpots(MakeButton(roundness, Black(), macos ? lw : DPI(2), Null), DPI(3), lw, 0, 0); + s.coloredge = WithHotSpots(MakeButton(roundness, Black(), DPI(2), Null), DPI(3), lw, 0, 0); auto Middle = [&](Image m) { ImageBuffer ib(m); for(int y = 0; y < lw; y++) diff --git a/uppsrc/CtrlLib/LabelBase.cpp b/uppsrc/CtrlLib/LabelBase.cpp index a018ab458..197ccee4d 100644 --- a/uppsrc/CtrlLib/LabelBase.cpp +++ b/uppsrc/CtrlLib/LabelBase.cpp @@ -479,10 +479,6 @@ void ActiveEdgeFrame::FramePaint(Draw& w, const Rect& r) : CTRL_NORMAL; } ChPaintEdge(w, r, edge[i]); -// if(i == CTRL_DISABLED) { -// DLOG(!IsNull(coloredge) << " " << color); -// ASSERT(color.GetR() != 255); -// } if(!IsNull(coloredge)) ChPaintEdge(w, r, coloredge, color); } diff --git a/uppsrc/Draw/Display.cpp b/uppsrc/Draw/Display.cpp index 0a4edb6f2..f38e45e8e 100644 --- a/uppsrc/Draw/Display.cpp +++ b/uppsrc/Draw/Display.cpp @@ -152,7 +152,7 @@ void StdDisplayClass::Paint0(Draw& w, const Rect& r, const Value& q, x = r.right - tsz.cx; if(a == ALIGN_CENTER) x += (width - tsz.cx) / 2; - int tcy = GetTLTextHeight(txt, font); + int tcy = tsz.cy; int tt = r.top + (tcy < 4 * r.GetHeight() / 3 ? (r.Height() - tcy) / 2 : 0); // allow negative tt if only slightly bigger if(tsz.cx > width) { Size isz = DrawImg::threedots().GetSize(); diff --git a/uppsrc/Draw/DrawTextUtil.cpp b/uppsrc/Draw/DrawTextUtil.cpp index b761ca585..c7ba73990 100644 --- a/uppsrc/Draw/DrawTextUtil.cpp +++ b/uppsrc/Draw/DrawTextUtil.cpp @@ -41,7 +41,7 @@ void DrawTextEllipsis(Draw& w, int x, int y, int cx, const char *text, const cha Size GetTLTextSize(const wchar *text, Font font) { Size sz(0, 0); - int cy = font.Info().GetHeight(); + int cy = font.GetCy(); const wchar *s = text; const wchar *t = s; for(;;) { @@ -70,19 +70,12 @@ Size GetTLTextSize(const wchar *text, Font font) int GetTLTextHeight(const wchar *s, Font font) { - int cy = font.Info().GetHeight(); - int h = cy; - while(*s) { - if(*s == '\n') - h += cy; - s++; - } - return h; + return GetTLTextSize(s, font).cy; } void DrawTLText(Draw& draw, int x, int y, int cx, const wchar *text, Font font, Color ink, int accesskey) { - int cy = font.Info().GetHeight(); + int cy = font.GetCy(); // Bold to have the same height as with GetStdFontCy() const wchar *s = text; const wchar *t = s; int apos = HIWORD(accesskey); diff --git a/uppsrc/Draw/Font.cpp b/uppsrc/Draw/Font.cpp index c7fd851f9..1292c6073 100644 --- a/uppsrc/Draw/Font.cpp +++ b/uppsrc/Draw/Font.cpp @@ -117,7 +117,7 @@ int Font::FindFaceNameIndex(const String& name) { void Font::SyncStdFont() { Mutex::Lock __(sFontLock); - StdFontSize = Size(AStdFont.GetAveWidth(), AStdFont().Bold().GetCy()); + StdFontSize = Size(AStdFont.GetAveWidth(), AStdFont().GetCy()); LLOG("SyncStdFont " << StdFontSize); SyncUHDMode(); }