From 0d2eb533f18dbd2330f5bd48b6a154a3c87b84d2 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 3 Apr 2018 09:11:25 +0200 Subject: Add a menu with global actions to SmGlobals Use it in the toolbar for FSWidge and hide the menuBar. Change Helper::icon to accept different foreground colors and wether to draw the ellipse. --- helper.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'helper.cpp') diff --git a/helper.cpp b/helper.cpp index 5e52bb2..d9a2856 100644 --- a/helper.cpp +++ b/helper.cpp @@ -433,7 +433,7 @@ namespace Helper { return retval; } - const QIcon icon(const QColor &bg, const QChar c, bool bold){ + const QIcon icon(const QColor &bg, const QColor &fg, const QChar c, bool bold, bool drawEllipse){ QImage img(32, 32, QImage::Format_ARGB32); img.fill(QColor(0, 0, 0, 0)); QPainter *p = new QPainter(&img); @@ -444,8 +444,10 @@ namespace Helper { QFont f("courier new"); f.setPixelSize(30); f.setBold(bold); - p->setPen(Qt::white); - p->drawEllipse(img.rect()); + p->setPen(fg); + if(drawEllipse){ + p->drawEllipse(img.rect()); + } p->setFont(f); p->drawText(img.rect(), Qt::AlignCenter, c); delete p; -- cgit v1.2.3-70-g09d2