Merge pull request #113 from mammonsama666/qlabel

Hide engine settings in setting widget.
This commit is contained in:
iaom 2021-01-28 18:41:28 +08:00 committed by GitHub
commit 54a71122e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 3 deletions

View File

@ -187,6 +187,7 @@ void SearchDetailView::setupWidget(const int& type, const QString& path) {
QFontMetrics fontMetrics = m_nameLabel->fontMetrics();
QString name = fontMetrics.elidedText(FileUtils::getFileName(path), Qt::ElideRight, 215);
m_nameLabel->setText(name);
m_nameLabel->setTextFormat(Qt::PlainText); //显示纯文本
m_typeLabel->setText(tr("Document"));
break;
}

View File

@ -152,6 +152,9 @@ void SettingsWidget::initUi() {
m_mainLyt->addWidget(m_searchEngineLabel);
m_mainLyt->addWidget(m_engineDescLabel);
m_mainLyt->addWidget(m_radioBtnFrame);
m_searchEngineLabel->hide();
m_engineDescLabel->hide();
m_radioBtnFrame->hide();
//取消与确认按钮 (隐藏)
// m_bottomBtnFrame = new QFrame(this);
@ -407,9 +410,19 @@ void SettingsWidget::paintEvent(QPaintEvent *event) {
*/
void SettingsWidget::resize()
{
if (m_blockdirs <= 1) {
this->setFixedSize(528, 455);
// if (m_blockdirs <= 1) {
// this->setFixedSize(528, 455);
// } else if (m_blockdirs <= 3) {
// this->setFixedSize(528, 425 + 30 * m_blockdirs);
// } else {
// this->setFixedSize(528, 515);
// }
if (m_blockdirs <= 3) {
m_dirListArea->setFixedHeight(32 * m_blockdirs);
m_dirListWidget->setFixedHeight(32 * m_blockdirs);
} else {
this->setFixedSize(528, 425 + 30 * m_blockdirs);
m_dirListWidget->setFixedHeight(32 * m_blockdirs);
m_dirListArea->setFixedHeight(32 * 3);
}
this->setFixedSize(528, 455);
}