forked from openkylin/ukui-search
Fix the incorrectly display of the ToolTip.
This commit is contained in:
parent
00a349e41b
commit
af3ea26b0a
|
@ -109,6 +109,8 @@ QWidget *AppSearchPlugin::detailPage(const ResultInfo &ri)
|
|||
m_nameLabel->setText(FileUtils::setAllTextBold(showname));
|
||||
if(QString::compare(showname, ri.name)) {
|
||||
m_nameLabel->setToolTip(ri.name);
|
||||
} else {
|
||||
m_nameLabel->setToolTip("");
|
||||
}
|
||||
m_pluginLabel->setText(tr("Application"));
|
||||
if(ri.type == 1) {
|
||||
|
|
|
@ -94,9 +94,11 @@ QWidget *FileSearchPlugin::detailPage(const ResultInfo &ri)
|
|||
QFontMetrics fontMetrics = m_nameLabel->fontMetrics();
|
||||
QString showname = fontMetrics.elidedText(ri.name, Qt::ElideRight, 215); //当字体长度超过215时显示为省略号
|
||||
m_nameLabel->setText(FileUtils::setAllTextBold(showname));
|
||||
//if(QString::compare(showname, ri.name)) {
|
||||
if(QString::compare(showname, ri.name)) {
|
||||
m_nameLabel->setToolTip(ri.name);
|
||||
//}
|
||||
} else {
|
||||
m_nameLabel->setToolTip("");
|
||||
}
|
||||
m_pluginLabel->setText(tr("File"));
|
||||
|
||||
m_pathLabel2->setText(m_pathLabel2->fontMetrics().elidedText(m_currentActionKey, Qt::ElideRight, m_pathLabel2->width()));
|
||||
|
@ -292,9 +294,11 @@ QWidget *DirSearchPlugin::detailPage(const ResultInfo &ri)
|
|||
QFontMetrics fontMetrics = m_nameLabel->fontMetrics();
|
||||
QString showname = fontMetrics.elidedText(ri.name, Qt::ElideRight, 215); //当字体长度超过215时显示为省略号
|
||||
m_nameLabel->setText(FileUtils::setAllTextBold(showname));
|
||||
//if(QString::compare(showname, ri.name)) {
|
||||
if(QString::compare(showname, ri.name)) {
|
||||
m_nameLabel->setToolTip(ri.name);
|
||||
//}
|
||||
} else {
|
||||
m_nameLabel->setToolTip("");
|
||||
}
|
||||
m_pluginLabel->setText(tr("directory"));
|
||||
|
||||
m_pathLabel2->setText(m_pathLabel2->fontMetrics().elidedText(m_currentActionKey, Qt::ElideRight, m_pathLabel2->width()));
|
||||
|
@ -474,9 +478,11 @@ QWidget *FileContengSearchPlugin::detailPage(const ResultInfo &ri)
|
|||
QFontMetrics fontMetrics = m_nameLabel->fontMetrics();
|
||||
QString showname = fontMetrics.elidedText(ri.name, Qt::ElideRight, 215); //当字体长度超过215时显示为省略号
|
||||
m_nameLabel->setText(FileUtils::setAllTextBold(showname));
|
||||
//if(QString::compare(showname, ri.name)) {
|
||||
if(QString::compare(showname, ri.name)) {
|
||||
m_nameLabel->setToolTip(ri.name);
|
||||
//}
|
||||
} else {
|
||||
m_nameLabel->setToolTip("");
|
||||
}
|
||||
|
||||
m_snippetLabel->setText(getHtmlText(wrapData(m_snippetLabel,ri.description.at(0).value), m_keyWord));
|
||||
m_pathLabel2->setText(m_pathLabel2->fontMetrics().elidedText(m_currentActionKey, Qt::ElideRight, m_pathLabel2->width()));
|
||||
|
|
|
@ -98,6 +98,8 @@ QWidget *MailSearchPlugin::detailPage(const SearchPluginIface::ResultInfo &ri)
|
|||
m_senderFieldsLabel->setText(FileUtils::escapeHtml(senderName));
|
||||
if (QString::compare(senderName, ri.description.at(0).value)) {
|
||||
m_senderFieldsLabel->setToolTip(ri.description.at(0).value);
|
||||
} else {
|
||||
m_nameLabel->setToolTip("");
|
||||
}
|
||||
|
||||
m_timeLabel->setText(ri.description.at(1).key);
|
||||
|
|
|
@ -74,6 +74,8 @@ QWidget *NoteSearchPlugin::detailPage(const SearchPluginIface::ResultInfo &ri)
|
|||
m_nameLabel->setText(FileUtils::setAllTextBold(showname));
|
||||
if(QString::compare(showname, ri.name)) {
|
||||
m_nameLabel->setToolTip(ri.name);
|
||||
} else {
|
||||
m_nameLabel->setToolTip("");
|
||||
}
|
||||
m_pluginLabel->setText(tr("Application"));
|
||||
QString showDesc = fontMetrics.elidedText(/*ri.description.at(0).key + " " + */ri.description.at(0).value, Qt::ElideRight, m_descLabel->width() * 2); //当字体长度超过215时显示为省略号
|
||||
|
|
|
@ -80,6 +80,8 @@ QWidget *SettingsSearchPlugin::detailPage(const ResultInfo &ri)
|
|||
m_nameLabel->setText(FileUtils::setAllTextBold(showname));
|
||||
if(QString::compare(showname, ri.name)) {
|
||||
m_nameLabel->setToolTip(ri.name);
|
||||
} else {
|
||||
m_nameLabel->setToolTip("");
|
||||
}
|
||||
return m_detailPage;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue