summaryrefslogtreecommitdiffstats
path: root/helper.cpp
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-04-03 09:11:25 +0200
committerArno <arno@disconnect.de>2018-04-03 09:11:25 +0200
commit0d2eb533f18dbd2330f5bd48b6a154a3c87b84d2 (patch)
tree6f471c93aabda83662934f30218cb658f9e30efa /helper.cpp
parentbac6fe431150bb5706fe0fb349e753b8fe08c12e (diff)
downloadSheMov-0d2eb533f18dbd2330f5bd48b6a154a3c87b84d2.tar.gz
SheMov-0d2eb533f18dbd2330f5bd48b6a154a3c87b84d2.tar.bz2
SheMov-0d2eb533f18dbd2330f5bd48b6a154a3c87b84d2.zip
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.
Diffstat (limited to 'helper.cpp')
-rw-r--r--helper.cpp8
1 files changed, 5 insertions, 3 deletions
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;