# HG changeset patch # User sheepluva # Date 1335824530 -7200 # Node ID 3273a2b983ca5db882a482ee137b79c0b479a944 # Parent 23722ba0f89af395eb6cffd6f83a6d04ad412b41 made the hog count thingy prettier when on low space... have fun squishing hogs! diff -r 23722ba0f89a -r 3273a2b983ca QTfrontend/ui/widget/hedgehogerWidget.cpp --- a/QTfrontend/ui/widget/hedgehogerWidget.cpp Mon Apr 30 23:14:40 2012 +0200 +++ b/QTfrontend/ui/widget/hedgehogerWidget.cpp Tue May 01 00:22:10 2012 +0200 @@ -35,7 +35,7 @@ } else numItems = 4; pOurFrameTeams->overallHedgehogs += numItems;*/ - this->setMinimumWidth(20); + this->setMinimumWidth(48); } void CHedgehogerWidget::incItems() @@ -83,12 +83,30 @@ { Q_UNUSED(event); - if (this->width() >= 11 * numItems + 28) + if (this->width() >= 11 * numItems + 26) ItemNum::paintEvent(event); + else + { + int width = this->width() - 38; + QPainter painter(this); + + for(int i=0; iwidth() - 14, 24, QString::number(numItems)); + painter.drawText(this->width() - 12, 24, QString::number(numItems)); } diff -r 23722ba0f89a -r 3273a2b983ca QTfrontend/ui/widget/itemNum.h --- a/QTfrontend/ui/widget/itemNum.h Mon Apr 30 23:14:40 2012 +0200 +++ b/QTfrontend/ui/widget/itemNum.h Tue May 01 00:22:10 2012 +0200 @@ -32,13 +32,12 @@ unsigned char getItemsNum() const; void setItemsNum(const unsigned char num); - private: + protected: QImage m_im; QImage m_img; bool infinityState; bool enabled; - protected: ItemNum(const QImage& im, const QImage& img, QWidget * parent, unsigned char min=2, unsigned char max=8); virtual QSize sizeHint () const; virtual ~ItemNum()=0;