ensurePolished();
updateMargins();
- connect(this, SIGNAL(textChanged(QString)), this, SLOT(checkButtons(QString)));
- connect(m_d->m_iconbutton[Left], SIGNAL(clicked()), this, SLOT(iconClicked()));
- connect(m_d->m_iconbutton[Right], SIGNAL(clicked()), this, SLOT(iconClicked()));
+ connect(this, SIGNAL(textChanged(QString)),
+ this, SLOT(checkButtons(QString)));
+ connect(m_d->m_iconbutton[Left], SIGNAL(clicked()),
+ this, SLOT(iconClicked()));
+ connect(m_d->m_iconbutton[Right], SIGNAL(clicked()),
+ this, SLOT(iconClicked()));
}
void FancyLineEdit::checkButtons(const QString &text)
if (iconpos == FancyLineEdit::Right) {
const int iconoffset = textMargins().right() + 4;
- m_d->m_iconbutton[i]->setGeometry(contentRect.adjusted(width() - iconoffset, 0, 0, 0));
+ m_d->m_iconbutton[i]->
+ setGeometry(contentRect.adjusted(width() - iconoffset, 0, 0, 0));
} else {
const int iconoffset = textMargins().left() + 4;
- m_d->m_iconbutton[i]->setGeometry(contentRect.adjusted(0, 0, -width() + iconoffset, 0));
+ m_d->m_iconbutton[i]->
+ setGeometry(contentRect.adjusted(0, 0, -width() + iconoffset, 0));
}
}
}
updateButtonPositions();
}
+
+void FancyLineEdit::keyPressEvent(QKeyEvent * e)
+{
+ if (e->type() == QEvent::KeyPress && e->key() == Qt::Key_Down)
+ Q_EMIT downPressed();
+ else
+ QLineEdit::keyPressEvent(e);
+}
+
+
void FancyLineEdit::setButtonPixmap(Side side, const QPixmap &buttonPixmap)
{
m_d->m_iconbutton[side]->setPixmap(buttonPixmap);
void IconButton::animateShow(bool visible)
{
if (visible) {
- QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity");
+ QPropertyAnimation *animation =
+ new QPropertyAnimation(this, "iconOpacity");
animation->setDuration(FADE_TIME);
animation->setEndValue(1.0);
animation->start(QAbstractAnimation::DeleteWhenStopped);
} else {
- QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity");
+ QPropertyAnimation *animation =
+ new QPropertyAnimation(this, "iconOpacity");
animation->setDuration(FADE_TIME);
animation->setEndValue(0.0);
animation->start(QAbstractAnimation::DeleteWhenStopped);
}
}
-}
+} // namespace frontend
-}
+} // namespace lyx
#endif // QT_VERSION >= 0x040600