Removed some unnecessary filter icons and added some new placeholder for the filter.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5779 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-11-06 00:28:11 +00:00
parent a9f70d0685
commit adee9517c1
13 changed files with 89 additions and 80 deletions

View File

@ -167,13 +167,11 @@ ForumsDialog::ForumsDialog(QWidget *parent)
lastViewType = -1; lastViewType = -1;
/* add filter actions */ /* add filter actions */
ui.filterLineEdit->addFilter(QIcon(), tr("Title"), COLUMN_THREAD_TITLE); ui.filterLineEdit->addFilter(QIcon(), tr("Title"), COLUMN_THREAD_TITLE, tr("Search Title"));
ui.filterLineEdit->addFilter(QIcon(), tr("Date"), COLUMN_THREAD_DATE); ui.filterLineEdit->addFilter(QIcon(), tr("Date"), COLUMN_THREAD_DATE, tr("Search Date"));
ui.filterLineEdit->addFilter(QIcon(), tr("Author"), COLUMN_THREAD_AUTHOR); ui.filterLineEdit->addFilter(QIcon(), tr("Author"), COLUMN_THREAD_AUTHOR, tr("Search Author"));
ui.filterLineEdit->addFilter(QIcon(), tr("Content"), COLUMN_THREAD_CONTENT); ui.filterLineEdit->addFilter(QIcon(), tr("Content"), COLUMN_THREAD_CONTENT, tr("Search Content"));
ui.filterLineEdit->setCurrentFilter(COLUMN_THREAD_TITLE); ui.filterLineEdit->setCurrentFilter(COLUMN_THREAD_TITLE);
// can be removed when the actions of the filter line edit have own placeholder text
ui.filterLineEdit->setPlaceholderText(tr("Search this forum...")) ;
// load settings // load settings
processSettings(true); processSettings(true);

View File

@ -92,7 +92,8 @@ FriendsDialog::FriendsDialog(QWidget *parent)
connect( ui.actionFriendRecommendations, SIGNAL(triggered()), this, SLOT(recommendFriends())); connect( ui.actionFriendRecommendations, SIGNAL(triggered()), this, SLOT(recommendFriends()));
connect( ui.filter_lineEdit, SIGNAL(textChanged(QString)), ui.friendList, SLOT(filterItems(QString))); connect( ui.filter_lineEdit, SIGNAL(textChanged(QString)), ui.friendList, SLOT(filterItems(QString)));
ui.filter_lineEdit->setPlaceholderText(tr("Search")) ; ui.filter_lineEdit->setPlaceholderText(tr("Search")) ;
ui.filter_lineEdit->showFilterIcon();
ui.avatar->setFrameType(AvatarWidget::STATUS_FRAME); ui.avatar->setFrameType(AvatarWidget::STATUS_FRAME);
ui.avatar->setOwnId(); ui.avatar->setOwnId();

View File

@ -226,8 +226,6 @@ MessagesDialog::MessagesDialog(QWidget *parent)
ui.filterLineEdit->addFilter(QIcon(), tr("Content"), COLUMN_CONTENT, tr("Search Content")); ui.filterLineEdit->addFilter(QIcon(), tr("Content"), COLUMN_CONTENT, tr("Search Content"));
ui.filterLineEdit->addFilter(QIcon(), tr("Tags"), COLUMN_TAGS, tr("Search Tags")); ui.filterLineEdit->addFilter(QIcon(), tr("Tags"), COLUMN_TAGS, tr("Search Tags"));
ui.filterLineEdit->addFilter(QIcon(), tr("Attachments"), COLUMN_ATTACHEMENTS, tr("Search Attachments")); ui.filterLineEdit->addFilter(QIcon(), tr("Attachments"), COLUMN_ATTACHEMENTS, tr("Search Attachments"));
// can be removed when the actions of the filter line edit have own placeholder text
ui.filterLineEdit->setPlaceholderText(tr("Search...")) ;
//setting default filter by column as subject //setting default filter by column as subject
ui.filterLineEdit->setCurrentFilter(COLUMN_SUBJECT); ui.filterLineEdit->setCurrentFilter(COLUMN_SUBJECT);

View File

@ -133,6 +133,9 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
ui.displaytoolButton->setMenu(ui.friendList->createDisplayMenu()); ui.displaytoolButton->setMenu(ui.friendList->createDisplayMenu());
ui.filterLineEdit->setPlaceholderText(tr("Search")) ;
ui.filterLineEdit->showFilterIcon();
// load settings // load settings
RsAutoUpdatePage::lockAllEvents(); RsAutoUpdatePage::lockAllEvents();
ui.friendList->setShowStatusColumn(false); ui.friendList->setShowStatusColumn(false);

View File

@ -14,7 +14,7 @@
<string>RetroShare Messenger</string> <string>RetroShare Messenger</string>
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="images.qrc"> <iconset>
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset> <normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
@ -118,28 +118,11 @@
<number>2</number> <number>2</number>
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <widget class="LineEditClear" name="filterLineEdit">
<property name="spacing"> <property name="toolTip">
<number>2</number> <string>Search Friends</string>
</property> </property>
<item> </widget>
<widget class="QLabel" name="filterLineLabel">
<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">
<string>Search Friends</string>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QToolButton" name="addIMAccountButton"> <widget class="QToolButton" name="addIMAccountButton">
@ -147,7 +130,7 @@
<string>Add a Friend</string> <string>Add a Friend</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset>
<normaloff>:/images/user/add_user24.png</normaloff>:/images/user/add_user24.png</iconset> <normaloff>:/images/user/add_user24.png</normaloff>:/images/user/add_user24.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
@ -167,7 +150,7 @@
<string>Share Files for your Friends</string> <string>Share Files for your Friends</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset>
<normaloff>:/images/friendsfolder24.png</normaloff>:/images/friendsfolder24.png</iconset> <normaloff>:/images/friendsfolder24.png</normaloff>:/images/friendsfolder24.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
@ -184,7 +167,7 @@
<item> <item>
<widget class="QToolButton" name="displaytoolButton"> <widget class="QToolButton" name="displaytoolButton">
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset>
<normaloff>:/images/looknfeel.png</normaloff>:/images/looknfeel.png</iconset> <normaloff>:/images/looknfeel.png</normaloff>:/images/looknfeel.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
@ -253,6 +236,11 @@
</widget> </widget>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
</customwidget>
<customwidget> <customwidget>
<class>AvatarWidget</class> <class>AvatarWidget</class>
<extends>QLabel</extends> <extends>QLabel</extends>
@ -265,11 +253,6 @@
<header>gui/common/FriendList.h</header> <header>gui/common/FriendList.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
</customwidget>
<customwidget> <customwidget>
<class>LogoBar</class> <class>LogoBar</class>
<extends>QFrame</extends> <extends>QFrame</extends>
@ -277,8 +260,6 @@
<container>1</container> <container>1</container>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources> <resources/>
<include location="images.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -166,8 +166,8 @@ NetworkDialog::NetworkDialog(QWidget *parent)
timer2->start(1000); timer2->start(1000);
/* add filter actions */ /* add filter actions */
ui.filterLineEdit->addFilter(QIcon(), tr("Name"), COLUMN_PEERNAME); ui.filterLineEdit->addFilter(QIcon(), tr("Name"), COLUMN_PEERNAME, tr("Search Name"));
ui.filterLineEdit->addFilter(QIcon(), tr("Peer ID"), COLUMN_PEERID); ui.filterLineEdit->addFilter(QIcon(), tr("Peer ID"), COLUMN_PEERID, tr("Search Peer ID"));
ui.filterLineEdit->setCurrentFilter(COLUMN_PEERNAME); ui.filterLineEdit->setCurrentFilter(COLUMN_PEERNAME);
updateNetworkStatus(); updateNetworkStatus();

View File

@ -97,6 +97,7 @@ FriendSelectionWidget::FriendSelectionWidget(QWidget *parent) :
ui->friendList->sortItems(COLUMN_NAME, Qt::AscendingOrder); ui->friendList->sortItems(COLUMN_NAME, Qt::AscendingOrder);
ui->filterLineEdit->setPlaceholderText(tr("Search Friends")); ui->filterLineEdit->setPlaceholderText(tr("Search Friends"));
ui->filterLineEdit->showFilterIcon();
} }
FriendSelectionWidget::~FriendSelectionWidget() FriendSelectionWidget::~FriendSelectionWidget()

View File

@ -88,8 +88,6 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) :
ui->filterLineEdit->addFilter(QIcon(), tr("Title"), FILTER_NAME_INDEX , tr("Search Title")); ui->filterLineEdit->addFilter(QIcon(), tr("Title"), FILTER_NAME_INDEX , tr("Search Title"));
ui->filterLineEdit->addFilter(QIcon(), tr("Description"), FILTER_DESC_INDEX , tr("Search Description")); ui->filterLineEdit->addFilter(QIcon(), tr("Description"), FILTER_DESC_INDEX , tr("Search Description"));
ui->filterLineEdit->setCurrentFilter(FILTER_NAME_INDEX); ui->filterLineEdit->setCurrentFilter(FILTER_NAME_INDEX);
// can be removed when the actions of the filter line edit have own placeholder text
ui->filterLineEdit->setPlaceholderText(tr("Enter a Keyword here"));
} }
GroupTreeWidget::~GroupTreeWidget() GroupTreeWidget::~GroupTreeWidget()

View File

@ -35,17 +35,7 @@ LineEditClear::LineEditClear(QWidget *parent)
: QLineEdit(parent) : QLineEdit(parent)
{ {
mActionGroup = NULL; mActionGroup = NULL;
mFilterButton = NULL;
mFilterButton = new QToolButton(this);
mFilterButton->setFixedSize(16, 16);
QPixmap filterPixmap(IMAGE_FILTER);
mFilterButton->setIcon(QIcon(filterPixmap));
mFilterButton->setIconSize(filterPixmap.size());
mFilterButton->setCursor(Qt::ArrowCursor);
mFilterButton->setStyleSheet("QToolButton { border: none; padding: 0px; }"
"QToolButton[popupMode=\"2\"] { padding-right: 10px; }"
"QToolButton::menu-indicator[popupMode=\"2\"] { subcontrol-origin: padding; subcontrol-position: bottom right; top: 5px; left: -3px; width: 7px; }");
mFilterButton->move(2, 2);
mClearButton = new QToolButton(this); mClearButton = new QToolButton(this);
mClearButton->setFixedSize(16, 16); mClearButton->setFixedSize(16, 16);
@ -70,7 +60,7 @@ LineEditClear::LineEditClear(QWidget *parent)
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
QSize msz = minimumSizeHint(); QSize msz = minimumSizeHint();
setMinimumSize( setMinimumSize(
qMax(msz.width(), mClearButton->sizeHint().height() + mFilterButton->sizeHint().width() + frameWidth * 2), qMax(msz.width(), mClearButton->sizeHint().height() + /*mFilterButton->sizeHint().width() + */frameWidth * 2),
qMax(msz.height(), mClearButton->sizeHint().height() + frameWidth * 2)); qMax(msz.height(), mClearButton->sizeHint().height() + frameWidth * 2));
} }
@ -82,7 +72,7 @@ void LineEditClear::resizeEvent(QResizeEvent *)
#if QT_VERSION < 0x040700 #if QT_VERSION < 0x040700
sz = mFilterLabel->sizeHint(); sz = mFilterLabel->sizeHint();
mFilterLabel->move(frameWidth + mFilterButton->sizeHint().width() + 5, (rect().bottom() + 1 - sz.height())/2); mFilterLabel->move(frameWidth + (mFilterButton ? mFilterButton->sizeHint().width() + 5 : 0), (rect().bottom() + 1 - sz.height())/2);
#endif #endif
} }
@ -118,7 +108,27 @@ void LineEditClear::reposButtons()
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
setStyleSheet(QString("QLineEdit { padding-right: %1px; padding-left: %2px; }") setStyleSheet(QString("QLineEdit { padding-right: %1px; padding-left: %2px; }")
.arg(mClearButton->sizeHint().width() + frameWidth + 1) .arg(mClearButton->sizeHint().width() + frameWidth + 1)
.arg(mFilterButton->sizeHint().width() + frameWidth + 1)); .arg(mFilterButton ? mFilterButton->sizeHint().width() + frameWidth + 1 : 0));
}
void LineEditClear::showFilterIcon()
{
if (mFilterButton) {
return;
}
mFilterButton = new QToolButton(this);
mFilterButton->setFixedSize(16, 16);
QPixmap filterPixmap(IMAGE_FILTER);
mFilterButton->setIcon(QIcon(filterPixmap));
mFilterButton->setIconSize(filterPixmap.size());
mFilterButton->setCursor(Qt::ArrowCursor);
mFilterButton->setStyleSheet("QToolButton { border: none; padding: 0px; }"
"QToolButton[popupMode=\"2\"] { padding-right: 10px; }"
"QToolButton::menu-indicator[popupMode=\"2\"] { subcontrol-origin: padding; subcontrol-position: bottom right; top: 5px; left: -3px; width: 7px; }");
mFilterButton->move(2, 2);
reposButtons();
} }
void LineEditClear::updateClearButton(const QString& text) void LineEditClear::updateClearButton(const QString& text)
@ -133,6 +143,8 @@ void LineEditClear::addFilter(const QIcon &icon, const QString &text, int id, co
action->setCheckable(true); action->setCheckable(true);
mDescription[id] = description; mDescription[id] = description;
showFilterIcon();
if (mActionGroup == NULL) { if (mActionGroup == NULL) {
mFilterButton->setFixedSize(26, 16); mFilterButton->setFixedSize(26, 16);
mFilterButton->setPopupMode(QToolButton::InstantPopup); mFilterButton->setPopupMode(QToolButton::InstantPopup);
@ -157,6 +169,10 @@ void LineEditClear::addFilter(const QIcon &icon, const QString &text, int id, co
void LineEditClear::setCurrentFilter(int id) void LineEditClear::setCurrentFilter(int id)
{ {
if (mFilterButton == NULL) {
return;
}
QMenu *menu = mFilterButton->menu(); QMenu *menu = mFilterButton->menu();
if (menu) { if (menu) {
Q_FOREACH (QAction *action, menu->actions()) { Q_FOREACH (QAction *action, menu->actions()) {

View File

@ -43,6 +43,8 @@ public:
void setCurrentFilter(int id); void setCurrentFilter(int id);
int currentFilter(); int currentFilter();
void showFilterIcon();
//#if QT_VERSION < 0x040700 //#if QT_VERSION < 0x040700
// for Qt version with setPlaceholderText too to set the tooltip of the lineedit // for Qt version with setPlaceholderText too to set the tooltip of the lineedit
void setPlaceholderText(const QString &text); void setPlaceholderText(const QString &text);

View File

@ -114,6 +114,8 @@ ImHistoryBrowser::ImHistoryBrowser(const std::string &peerId, QTextEdit *edit, Q
connect(ui.listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(itemSelectionChanged())); connect(ui.listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(itemSelectionChanged()));
connect(ui.listWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint))); connect(ui.listWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint)));
ui.filterLineEdit->showFilterIcon();
// embed smileys ? // embed smileys ?
if (m_isPrivateChat) { if (m_isPrivateChat) {
embedSmileys = Settings->valueFromGroup("Chat", "Emoteicons_PrivatChat", true).toBool(); embedSmileys = Settings->valueFromGroup("Chat", "Emoteicons_PrivatChat", true).toBool();

View File

@ -49,7 +49,10 @@
</size> </size>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="margin"> <property name="topMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number> <number>2</number>
</property> </property>
<item> <item>
@ -57,16 +60,6 @@
<property name="spacing"> <property name="spacing">
<number>1</number> <number>1</number>
</property> </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> <item>
<widget class="LineEditClear" name="filterLineEdit"/> <widget class="LineEditClear" name="filterLineEdit"/>
</item> </item>

View File

@ -4092,7 +4092,19 @@ p, li { white-space: pre-wrap; }
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<source>Search this forum...</source> <source>Search Title</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Search Date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Search Author</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Search Content</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
@ -5482,10 +5494,6 @@ p, li { white-space: pre-wrap; }
</context> </context>
<context> <context>
<name>GroupTreeWidget</name> <name>GroupTreeWidget</name>
<message>
<source>Enter a Keyword here</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Title</source> <source>Title</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -7234,10 +7242,6 @@ Do you want to save message ?</source>
<source>Search Attachments</source> <source>Search Attachments</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Search...</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MessengerWindow</name> <name>MessengerWindow</name>
@ -7257,6 +7261,10 @@ Do you want to save message ?</source>
<source>Search Friends</source> <source>Search Friends</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MsgItem</name> <name>MsgItem</name>
@ -7535,6 +7543,14 @@ Right-click and select &apos;make friend&apos; to be able to connect.</source>
<source>Display</source> <source>Display</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Search Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Search Peer ID</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>NetworkPage</name> <name>NetworkPage</name>