tweaks for qt 4.7
[fapman] / dimmer.cpp
index fdff869..1e539b6 100644 (file)
@@ -24,12 +24,15 @@ dimmer::dimmer(QWidget *parent) :
     QWidget(parent)
 {
        iParent = parent;
-       iAlpha = 205;
+
        iLayout = new QVBoxLayout(this);
        iLabel = new QLabel(this);
        iLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
        iLabel->setAlignment(Qt::AlignCenter);
        iLayout->addWidget(iLabel);
+       iLayout->setSizeConstraint(QLayout::SetMaximumSize);
+
+       iAlpha = 205;
        iBusy = false;
        iAnim = 0;
        iAnimDir = 1;
@@ -38,6 +41,7 @@ dimmer::dimmer(QWidget *parent) :
        iUpdateAnim = false;
        iDownloadSpeed = -1;
 
+
        iTimer = new QTimer(this);
        connect(iTimer,SIGNAL(timeout()),this,SLOT(timerEvent()));
 
@@ -106,17 +110,15 @@ void dimmer::timerEvent()
        iUpdateAnim = false;
 }
 
-void dimmer::resizeEvent(QResizeEvent *)
+void dimmer::resizeEvent(QResizeEvent* event)
 {
-       this->resize(iParent->size());
-       iLayout->setGeometry(iParent->rect());
-       iLayout->setSizeConstraint(QLayout::SetMaximumSize);
-       iAnimY = this->rect().height()-this->rect().height()/4;
+       iAnimY = this->rect().height() - this->rect().height() / 4;
+       QWidget::resizeEvent(event);
 }
 
 void dimmer::orientationChanged()
 {
-       resizeEvent(0);
+       //resize( iParent->size() );
 }
 
 void dimmer::dim(QString title, QString message)
@@ -131,6 +133,9 @@ void dimmer::dim(QString title, QString message)
        iAnimDir = 1;
 
        show();
+
+       resize(iParent->size());
+
        iTimer->start(250);
 }