fix(app-search-plugin):修复在线应用右侧被遮挡的问题,优化在线应用描述界面ui
This commit is contained in:
parent
4e7e2e3a8a
commit
ee1af87ccd
|
@ -159,11 +159,11 @@ QWidget *AppSearchPlugin::detailPage(const ResultInfo &ri)
|
||||||
// QString showDesc = fontMetrics.elidedText(ri.description.at(0).key + " " + ri.description.at(0).value, Qt::ElideRight, 3114); //当字体长度超过215时显示为省略号
|
// QString showDesc = fontMetrics.elidedText(ri.description.at(0).key + " " + ri.description.at(0).value, Qt::ElideRight, 3114); //当字体长度超过215时显示为省略号
|
||||||
QString showDesc = FileUtils::getSnippetWithoutKeyword(ri.description.at(0).key + " " + ri.description.at(0).value, 10);
|
QString showDesc = FileUtils::getSnippetWithoutKeyword(ri.description.at(0).key + " " + ri.description.at(0).value, 10);
|
||||||
m_descLabel->setText(FileUtils::escapeHtml(showDesc));
|
m_descLabel->setText(FileUtils::escapeHtml(showDesc));
|
||||||
m_descFrame->show();
|
m_descLabel->show();
|
||||||
m_line_2->show();
|
m_line_2->show();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
m_descFrame->hide();
|
m_descLabel->hide();
|
||||||
m_line_2->hide();
|
m_line_2->hide();
|
||||||
m_actionLabel1->show();
|
m_actionLabel1->show();
|
||||||
m_actionLabel2->show();
|
m_actionLabel2->show();
|
||||||
|
@ -232,14 +232,11 @@ void AppSearchPlugin::initDetailPage()
|
||||||
m_nameFrameLyt->addWidget(m_pluginLabel);
|
m_nameFrameLyt->addWidget(m_pluginLabel);
|
||||||
|
|
||||||
m_line_1 = new SeparationLine(m_detailPage);
|
m_line_1 = new SeparationLine(m_detailPage);
|
||||||
m_descFrame = new QFrame(m_detailPage);
|
|
||||||
m_descFrameLyt = new QVBoxLayout(m_descFrame);
|
m_descLabel = new QLabel(m_detailPage);
|
||||||
m_descLabel = new QLabel(m_descFrame);
|
|
||||||
m_descLabel->setTextFormat(Qt::PlainText);
|
m_descLabel->setTextFormat(Qt::PlainText);
|
||||||
|
m_descLabel->setContentsMargins(8, 0, 8, 0);
|
||||||
// m_descLabel->setWordWrap(true);
|
// m_descLabel->setWordWrap(true);
|
||||||
m_descFrameLyt->addWidget(m_descLabel);
|
|
||||||
m_descFrame->setLayout(m_descFrameLyt);
|
|
||||||
m_descFrameLyt->setContentsMargins(8, 0, 0, 0);
|
|
||||||
m_line_2 = new SeparationLine(m_detailPage);
|
m_line_2 = new SeparationLine(m_detailPage);
|
||||||
|
|
||||||
m_actionFrame = new QFrame(m_detailPage);
|
m_actionFrame = new QFrame(m_detailPage);
|
||||||
|
@ -260,7 +257,7 @@ void AppSearchPlugin::initDetailPage()
|
||||||
m_detailLyt->addWidget(m_iconLabel);
|
m_detailLyt->addWidget(m_iconLabel);
|
||||||
m_detailLyt->addWidget(m_nameFrame);
|
m_detailLyt->addWidget(m_nameFrame);
|
||||||
m_detailLyt->addWidget(m_line_1);
|
m_detailLyt->addWidget(m_line_1);
|
||||||
m_detailLyt->addWidget(m_descFrame);
|
m_detailLyt->addWidget(m_descLabel);
|
||||||
m_detailLyt->addWidget(m_line_2);
|
m_detailLyt->addWidget(m_line_2);
|
||||||
m_detailLyt->addWidget(m_actionFrame);
|
m_detailLyt->addWidget(m_actionFrame);
|
||||||
m_detailPage->setLayout(m_detailLyt);
|
m_detailPage->setLayout(m_detailLyt);
|
||||||
|
|
|
@ -84,9 +84,7 @@ private:
|
||||||
QLabel *m_nameLabel = nullptr;
|
QLabel *m_nameLabel = nullptr;
|
||||||
QLabel *m_pluginLabel = nullptr;
|
QLabel *m_pluginLabel = nullptr;
|
||||||
SeparationLine *m_line_1 = nullptr;
|
SeparationLine *m_line_1 = nullptr;
|
||||||
QFrame *m_descFrame = nullptr;
|
|
||||||
QLabel *m_descLabel = nullptr;
|
QLabel *m_descLabel = nullptr;
|
||||||
QVBoxLayout *m_descFrameLyt = nullptr;
|
|
||||||
SeparationLine *m_line_2 = nullptr;
|
SeparationLine *m_line_2 = nullptr;
|
||||||
QFrame *m_actionFrame = nullptr;
|
QFrame *m_actionFrame = nullptr;
|
||||||
QVBoxLayout *m_actionFrameLyt = nullptr;
|
QVBoxLayout *m_actionFrameLyt = nullptr;
|
||||||
|
|
|
@ -1390,7 +1390,7 @@ QString FileUtils::getSnippetWithoutKeyword(const QString &content, int lineCoun
|
||||||
}
|
}
|
||||||
QString word = content.mid(boundaryStart, boundaryEnd - boundaryStart);
|
QString word = content.mid(boundaryStart, boundaryEnd - boundaryStart);
|
||||||
wordCount += boundaryEnd - boundaryStart;
|
wordCount += boundaryEnd - boundaryStart;
|
||||||
length = fontMetricsF.horizontalAdvance(content.mid(boundaryStart - wordCount, wordCount));
|
length = fontMetricsF.horizontalAdvance(content.mid(boundaryEnd - wordCount, wordCount));
|
||||||
|
|
||||||
if (length >= LABEL_MAX_WIDTH || word == "\n") {
|
if (length >= LABEL_MAX_WIDTH || word == "\n") {
|
||||||
if (word == "\n") {
|
if (word == "\n") {
|
||||||
|
|
|
@ -25,30 +25,30 @@
|
||||||
<name>UkuiSearch::AppSearchPlugin</name>
|
<name>UkuiSearch::AppSearchPlugin</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="30"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="30"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="247"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="245"/>
|
||||||
<source>Open</source>
|
<source>Open</source>
|
||||||
<translation>སྒོ་ཕྱེ་བ།</translation>
|
<translation>སྒོ་ཕྱེ་བ།</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="31"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="31"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="246"/>
|
||||||
<source>Add Shortcut to Desktop</source>
|
<source>Add Shortcut to Desktop</source>
|
||||||
<translation>ཅོག་ངོས་སུ་མྱུར་འཐེབ་སྣོན་པ།</translation>
|
<translation>ཅོག་ངོས་སུ་མྱུར་འཐེབ་སྣོན་པ།</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="32"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="32"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="249"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="247"/>
|
||||||
<source>Add Shortcut to Panel</source>
|
<source>Add Shortcut to Panel</source>
|
||||||
<translation>ལས་འགན་གྱི་སྒྲོམ་ཐོག་མགྱོགས་མྱུར་གྱི་བྱེད་ཐབས་གསར་སྣོན་བྱ་དགོས</translation>
|
<translation>ལས་འགན་གྱི་སྒྲོམ་ཐོག་མགྱོགས་མྱུར་གྱི་བྱེད་ཐབས་གསར་སྣོན་བྱ་དགོས</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="33"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="33"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="250"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
|
||||||
<source>Install</source>
|
<source>Install</source>
|
||||||
<translation>སྒྲིག་སྦྱོར་བྱེད་པ</translation>
|
<translation>སྒྲིག་སྦྱོར་བྱེད་པ</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="195"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="196"/>
|
||||||
<source>Application Description:</source>
|
<source>Application Description:</source>
|
||||||
<translation>ཉེར་སྤྱོད་གོ་རིམ་གྱི་གསལ་བཤད།</translation>
|
<translation>ཉེར་སྤྱོད་གོ་རིམ་གྱི་གསལ་བཤད།</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -32,25 +32,25 @@
|
||||||
<name>UkuiSearch::AppSearchPlugin</name>
|
<name>UkuiSearch::AppSearchPlugin</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="30"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="30"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="247"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="245"/>
|
||||||
<source>Open</source>
|
<source>Open</source>
|
||||||
<translation>ᠨᠡᠬᠡᠬᠡᠬᠦ᠌</translation>
|
<translation>ᠨᠡᠬᠡᠬᠡᠬᠦ᠌</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="31"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="31"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="246"/>
|
||||||
<source>Add Shortcut to Desktop</source>
|
<source>Add Shortcut to Desktop</source>
|
||||||
<translation>ᠱᠢᠷᠡᠭᠡᠨ ᠨᠢᠭᠤᠷᠤᠨ ᠲᠦᠳᠡ ᠴᠦᠷᠬᠡᠶᠢᠨ ᠠᠷᠭᠠᠳᠤ ᠨᠡᠮᠡᠬᠦ᠌</translation>
|
<translation>ᠱᠢᠷᠡᠭᠡᠨ ᠨᠢᠭᠤᠷᠤᠨ ᠲᠦᠳᠡ ᠴᠦᠷᠬᠡᠶᠢᠨ ᠠᠷᠭᠠᠳᠤ ᠨᠡᠮᠡᠬᠦ᠌</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="32"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="32"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="249"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="247"/>
|
||||||
<source>Add Shortcut to Panel</source>
|
<source>Add Shortcut to Panel</source>
|
||||||
<translation>ᠡᠬᠦᠷᠭᠡᠶᠢᠨ ᠬᠡᠷᠡᠭᠰᠡᠬᠡᠶᠢᠨ ᠲᠦᠲᠡ ᠴᠦᠷᠬᠡᠳᠦ ᠨᠡᠮᠡᠬᠦ᠌</translation>
|
<translation>ᠡᠬᠦᠷᠭᠡᠶᠢᠨ ᠬᠡᠷᠡᠭᠰᠡᠬᠡᠶᠢᠨ ᠲᠦᠲᠡ ᠴᠦᠷᠬᠡᠳᠦ ᠨᠡᠮᠡᠬᠦ᠌</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="33"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="33"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="250"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
|
||||||
<source>Install</source>
|
<source>Install</source>
|
||||||
<translation>ᠤᠭᠰᠠᠷᠠᠬᠤ</translation>
|
<translation>ᠤᠭᠰᠠᠷᠠᠬᠤ</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
<translation>ᠬᠡᠷᠡᠭᠯᠡᠯᠳᠡ</translation>
|
<translation>ᠬᠡᠷᠡᠭᠯᠡᠯᠳᠡ</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="195"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="196"/>
|
||||||
<source>Application Description:</source>
|
<source>Application Description:</source>
|
||||||
<translation>应用描述:</translation>
|
<translation>应用描述:</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -32,25 +32,25 @@
|
||||||
<name>UkuiSearch::AppSearchPlugin</name>
|
<name>UkuiSearch::AppSearchPlugin</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="30"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="30"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="247"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="245"/>
|
||||||
<source>Open</source>
|
<source>Open</source>
|
||||||
<translation>打开</translation>
|
<translation>打开</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="31"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="31"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="246"/>
|
||||||
<source>Add Shortcut to Desktop</source>
|
<source>Add Shortcut to Desktop</source>
|
||||||
<translation>添加到桌面快捷方式</translation>
|
<translation>添加到桌面快捷方式</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="32"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="32"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="249"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="247"/>
|
||||||
<source>Add Shortcut to Panel</source>
|
<source>Add Shortcut to Panel</source>
|
||||||
<translation>添加到任务栏快捷方式</translation>
|
<translation>添加到任务栏快捷方式</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="33"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="33"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="250"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
|
||||||
<source>Install</source>
|
<source>Install</source>
|
||||||
<translation>安装</translation>
|
<translation>安装</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
<translation>应用</translation>
|
<translation>应用</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="195"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="196"/>
|
||||||
<source>Application Description:</source>
|
<source>Application Description:</source>
|
||||||
<translation>应用描述:</translation>
|
<translation>应用描述:</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -18,25 +18,25 @@
|
||||||
<name>UkuiSearch::AppSearchPlugin</name>
|
<name>UkuiSearch::AppSearchPlugin</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="30"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="30"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="247"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="245"/>
|
||||||
<source>Open</source>
|
<source>Open</source>
|
||||||
<translation>打開</translation>
|
<translation>打開</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="31"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="31"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="246"/>
|
||||||
<source>Add Shortcut to Desktop</source>
|
<source>Add Shortcut to Desktop</source>
|
||||||
<translation>添加到桌面快捷方式</translation>
|
<translation>添加到桌面快捷方式</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="32"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="32"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="249"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="247"/>
|
||||||
<source>Add Shortcut to Panel</source>
|
<source>Add Shortcut to Panel</source>
|
||||||
<translation>添加到任務列快捷方式</translation>
|
<translation>添加到任務列快捷方式</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="33"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="33"/>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="250"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
|
||||||
<source>Install</source>
|
<source>Install</source>
|
||||||
<translation>安裝</translation>
|
<translation>安裝</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
<translation>應用</translation>
|
<translation>應用</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="195"/>
|
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="196"/>
|
||||||
<source>Application Description:</source>
|
<source>Application Description:</source>
|
||||||
<translation>應用描述:</translation>
|
<translation>應用描述:</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
Loading…
Reference in New Issue