forked from qt-creator/qt-creator
FancyLineEdit: De-duplicate some code
Change-Id: Ia9bf5db44d4546ae756d2d4ecca3c4057076f69a Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
This commit is contained in:
@@ -542,17 +542,10 @@ void IconButton::paintEvent(QPaintEvent *)
|
|||||||
|
|
||||||
void IconButton::animateShow(bool visible)
|
void IconButton::animateShow(bool visible)
|
||||||
{
|
{
|
||||||
if (visible) {
|
QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity");
|
||||||
QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity");
|
animation->setDuration(FADE_TIME);
|
||||||
animation->setDuration(FADE_TIME);
|
animation->setEndValue(visible ? 1.0 : 0.0);
|
||||||
animation->setEndValue(1.0);
|
animation->start(QAbstractAnimation::DeleteWhenStopped);
|
||||||
animation->start(QAbstractAnimation::DeleteWhenStopped);
|
|
||||||
} else {
|
|
||||||
QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity");
|
|
||||||
animation->setDuration(FADE_TIME);
|
|
||||||
animation->setEndValue(0.0);
|
|
||||||
animation->start(QAbstractAnimation::DeleteWhenStopped);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize IconButton::sizeHint() const
|
QSize IconButton::sizeHint() const
|
||||||
|
|||||||
Reference in New Issue
Block a user