mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-08 06:32:55 -04:00
Added a find Icon Button for the class LineEditClear
Removed all not needed find icons from the Dialogs. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5727 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9ea1a7ab24
commit
c7c695600f
6 changed files with 14 additions and 68 deletions
|
@ -28,6 +28,13 @@
|
|||
LineEditClear::LineEditClear(QWidget *parent)
|
||||
: QLineEdit(parent)
|
||||
{
|
||||
findButton = new QToolButton(this);
|
||||
QPixmap findPixmap(":/images/find-16.png");
|
||||
findButton->setIcon(QIcon(findPixmap));
|
||||
findButton->setIconSize(findPixmap.size());
|
||||
findButton->setCursor(Qt::ArrowCursor);
|
||||
findButton->setStyleSheet("QToolButton { border: none; padding: 0px; }");
|
||||
|
||||
clearButton = new QToolButton(this);
|
||||
clearButton->setFixedSize(16, 16);
|
||||
clearButton->setIconSize(QSize(16, 16));
|
||||
|
@ -42,7 +49,9 @@ LineEditClear::LineEditClear(QWidget *parent)
|
|||
connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(updateCloseButton(const QString&)));
|
||||
|
||||
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
|
||||
setStyleSheet(QString("QLineEdit { padding-right: %1px; } ").arg(clearButton->sizeHint().width() + frameWidth + 1));
|
||||
setStyleSheet(QString("QLineEdit { padding-right: %1px; padding-left: %2px; } ").
|
||||
arg(clearButton->sizeHint().width() + frameWidth + 1).
|
||||
arg(findButton->sizeHint().width() + frameWidth + 1));
|
||||
QSize msz = minimumSizeHint();
|
||||
setMinimumSize(qMax(msz.width(), clearButton->sizeHint().height() + frameWidth * 2), qMax(msz.height(), clearButton->sizeHint().height() + frameWidth * 2));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue