# HG changeset patch # User sheepluva # Date 1335820480 -7200 # Node ID 23722ba0f89af395eb6cffd6f83a6d04ad412b41 # Parent 1224c6fb36c3c7cc5f051a3866ef6cbc80271ac0 Qt: fix issue with hog count being not visible on low resolutions/long team names and hard to read on very high resolutions diff -r 1224c6fb36c3 -r 23722ba0f89a QTfrontend/ui/widget/hedgehogerWidget.cpp --- a/QTfrontend/ui/widget/hedgehogerWidget.cpp Mon Apr 30 23:35:40 2012 +0400 +++ b/QTfrontend/ui/widget/hedgehogerWidget.cpp Mon Apr 30 23:14:40 2012 +0200 @@ -19,6 +19,8 @@ #include "hedgehogerWidget.h" +#include + #include "frameTeam.h" CHedgehogerWidget::CHedgehogerWidget(const QImage& im, const QImage& img, QWidget * parent) : @@ -32,6 +34,8 @@ numItems = pOurFrameTeams->maxHedgehogsPerGame - pOurFrameTeams->overallHedgehogs; } else numItems = 4; pOurFrameTeams->overallHedgehogs += numItems;*/ + + this->setMinimumWidth(20); } void CHedgehogerWidget::incItems() @@ -74,3 +78,17 @@ { return numItems; } + +void CHedgehogerWidget::paintEvent(QPaintEvent* event) +{ + Q_UNUSED(event); + + if (this->width() >= 11 * numItems + 28) + ItemNum::paintEvent(event); + + QPainter painter(this); + const QFont font("MS Shell Dlg", 12); + painter.setFont(font); + painter.drawText(this->width() - 14, 24, QString::number(numItems)); + +} diff -r 1224c6fb36c3 -r 23722ba0f89a QTfrontend/ui/widget/hedgehogerWidget.h --- a/QTfrontend/ui/widget/hedgehogerWidget.h Mon Apr 30 23:35:40 2012 +0400 +++ b/QTfrontend/ui/widget/hedgehogerWidget.h Mon Apr 30 23:14:40 2012 +0200 @@ -42,6 +42,8 @@ virtual void incItems(); virtual void decItems(); + virtual void paintEvent(QPaintEvent* event); + private: CHedgehogerWidget(); FrameTeams* pOurFrameTeams;