mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Add Background to xprogressbar text for more readability.
This commit is contained in:
parent
6e8305abda
commit
311b190f67
@ -320,9 +320,14 @@ void xProgressBar::paint()
|
|||||||
// paint text?
|
// paint text?
|
||||||
if (displayText)
|
if (displayText)
|
||||||
{
|
{
|
||||||
QLocale locale;
|
QRect bounding = painter->boundingRect(rect, Qt::AlignCenter, QLocale().toString(_pinfo.progress, 'f', 2) + "%");
|
||||||
|
QColor color (255-textColor.red(), 255-textColor.green(), 255-textColor.blue(), 125);
|
||||||
|
painter->setPen(color);
|
||||||
|
painter->setBrush(QBrush(color));
|
||||||
|
painter->drawRect(bounding.adjusted(2,2,-4,-4));
|
||||||
|
|
||||||
painter->setPen(textColor);
|
painter->setPen(textColor);
|
||||||
painter->drawText(rect, Qt::AlignCenter, locale.toString(_pinfo.progress, 'f', 2) + "%");
|
painter->drawText(rect, Qt::AlignCenter, QLocale().toString(_pinfo.progress, 'f', 2) + "%");
|
||||||
}
|
}
|
||||||
|
|
||||||
backgroundColor.setRgb(255, 255, 255);
|
backgroundColor.setRgb(255, 255, 255);
|
||||||
|
Loading…
Reference in New Issue
Block a user