diff --git a/widget/include/Cevo/CevoScreenTools.h b/widget/include/Cevo/CevoScreenTools.h index 5b317c3..7309423 100644 --- a/widget/include/Cevo/CevoScreenTools.h +++ b/widget/include/Cevo/CevoScreenTools.h @@ -205,5 +205,8 @@ QString movementToString(int movement); // swatch at row 137+kind (DarkGradient), ending in a black L-shaped border. void lightGradient(Dpi::Canvas &canvas, int x, int y, int width, QColor color); void darkGradient(Dpi::Canvas &canvas, int x, int y, int width, int kind); +// ScreenTools.pas's NumberBar(): a labeled stat row (title + DLine divider +// + right-aligned number), skipped entirely if val <= 0. +void numberBar(Dpi::Canvas &canvas, int x, int y, const QString &cap, int val, const Texture &texture); } // namespace Cevo diff --git a/widget/src/CevoScreenTools.cpp b/widget/src/CevoScreenTools.cpp index d1ba0c8..6205c40 100644 --- a/widget/src/CevoScreenTools.cpp +++ b/widget/src/CevoScreenTools.cpp @@ -755,4 +755,14 @@ void darkGradient(Dpi::Canvas &canvas, int x, int y, int width, int kind) gradient(canvas, x, y, 0, 1, width, 0, color, brightness); } +void numberBar(Dpi::Canvas &canvas, int x, int y, const QString &cap, int val, const Texture &texture) +{ + if (val <= 0) + return; + dLine(canvas, x - 2, x + 170, y + 16, texture.colorBevelShade, texture.colorBevelLight); + loweredTextOut(canvas, -1, texture, x - 2, y, cap); + const QString s = QString::number(val); + risedTextOut(canvas, x + 170 - biColorTextWidth(canvas, s), y, s); +} + } // namespace Cevo