From e3da6e6f429c0b714aaddff865aeb45741137dbf Mon Sep 17 00:00:00 2001 From: zhangjiaping Date: Sat, 16 Jan 2021 16:16:26 +0800 Subject: [PATCH] feat(frontend): Set fixed height for titlelabel. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: 给列表标题设置固定高度以防滚动区域高度计算错误 Log: 给列表标题设置固定高度以防滚动区域高度计算错误 --- src/content-widget.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/content-widget.cpp b/src/content-widget.cpp index 629731a..e3f334c 100644 --- a/src/content-widget.cpp +++ b/src/content-widget.cpp @@ -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));