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:
defnax 2012-10-26 15:14:40 +00:00
parent 9ea1a7ab24
commit c7c695600f
6 changed files with 14 additions and 68 deletions

View File

@ -538,7 +538,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@ -553,16 +553,6 @@
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/find-16.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="LineEditClear" name="filterLineEdit">
<property name="toolTip">
@ -581,8 +571,7 @@
</size>
</property>
<property name="font">
<font>
</font>
<font/>
</property>
<property name="currentIndex">
<number>1</number>

View File

@ -372,16 +372,6 @@
<property name="spacing">
<number>1</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/find-16.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="LineEditClear" name="filterLineEdit"/>
</item>

View File

@ -175,16 +175,6 @@
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/find-16.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="LineEditClear" name="filterLineEdit">
<property name="toolTip">
@ -203,8 +193,7 @@
</size>
</property>
<property name="font">
<font>
</font>
<font/>
</property>
<property name="currentIndex">
<number>0</number>

View File

@ -172,31 +172,6 @@
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="searchLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/find-16.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="LineEditClear" name="lineEdit">
<property name="toolTip">
<string>Enter a keyword here (at least 3 char long)</string>
@ -319,13 +294,6 @@
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="label_3">
<property name="pixmap">
<pixmap resource="images.qrc">:/images/find-16.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="LineEditClear" name="filterLineEdit">
<property name="toolTip">

View File

@ -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));
}

View File

@ -42,6 +42,7 @@ private slots:
private:
QToolButton *clearButton;
QToolButton *findButton;
};
#endif // LINEEDITCLEAR_H