feat(frontend): Set fixed height for titlelabel.

Description: 给列表标题设置固定高度以防滚动区域高度计算错误

Log: 给列表标题设置固定高度以防滚动区域高度计算错误
This commit is contained in:
zhangjiaping 2021-01-16 16:16:26 +08:00
parent 6a2563d4dc
commit e3da6e6f42
1 changed files with 6 additions and 0 deletions

View File

@ -92,26 +92,32 @@ void ContentWidget::initListView()
m_fileTitleLabel = new QLabel(m_resultList);
m_fileTitleLabel->setContentsMargins(8, 0, 0, 0);
m_fileTitleLabel->setFixedHeight(24);
m_fileTitleLabel->setStyleSheet("QLabel{background: rgba(0,0,0,0.1);}");
m_fileTitleLabel->setText(getTitleName(SearchItem::SearchType::Files));
m_dirTitleLabel = new QLabel(m_resultList);
m_dirTitleLabel->setContentsMargins(8, 0, 0, 0);
m_dirTitleLabel->setFixedHeight(24);
m_dirTitleLabel->setStyleSheet("QLabel{background: rgba(0,0,0,0.1);}");
m_dirTitleLabel->setText(getTitleName(SearchItem::SearchType::Dirs));
m_contentTitleLabel = new QLabel(m_resultList);
m_contentTitleLabel->setContentsMargins(8, 0, 0, 0);
m_contentTitleLabel->setFixedHeight(24);
m_contentTitleLabel->setStyleSheet("QLabel{background: rgba(0,0,0,0.1);}");
m_contentTitleLabel->setText(getTitleName(SearchItem::SearchType::Contents));
m_appTitleLabel = new QLabel(m_resultList);
m_appTitleLabel->setContentsMargins(8, 0, 0, 0);
m_appTitleLabel->setFixedHeight(24);
m_appTitleLabel->setStyleSheet("QLabel{background: rgba(0,0,0,0.1);}");
m_appTitleLabel->setText(getTitleName(SearchItem::SearchType::Apps));
m_settingTitleLabel = new QLabel(m_resultList);
m_settingTitleLabel->setContentsMargins(8, 0, 0, 0);
m_settingTitleLabel->setFixedHeight(24);
m_settingTitleLabel->setStyleSheet("QLabel{background: rgba(0,0,0,0.1);}");
m_settingTitleLabel->setText(getTitleName(SearchItem::SearchType::Settings));
m_bestTitleLabel = new QLabel(m_resultList);
m_bestTitleLabel->setContentsMargins(8, 0, 0, 0);
m_bestTitleLabel->setFixedHeight(24);
m_bestTitleLabel->setStyleSheet("QLabel{background: rgba(0,0,0,0.1);}");
m_bestTitleLabel->setText(getTitleName(SearchItem::SearchType::Best));