fix(frontend): Recently opened files displayed incorrectly in homepage.

Description: 修复主页面最近打开列表文件显示和排版有误的问题

Log: 修复主页面最近打开列表文件显示和排版有误的问题
This commit is contained in:
zhangjiaping 2021-02-05 17:32:27 +08:00
parent a4e9d7f2c6
commit 75f7ef25f2
3 changed files with 8 additions and 0 deletions

View File

@ -335,6 +335,11 @@ void ContentWidget::initHomePage() {
item->setFixedSize(265, 48);
layout->addWidget(item, j / 2, j % 2);
}
if (lists.at(i).length() == 1) {
QWidget * emptyItem = new QWidget(itemWidget);
emptyItem->setFixedSize(265, 48); //占位用widget,只有一项时在右方补全
layout->addWidget(emptyItem, 1, 2);
}
} else {
itemWidget->setFixedHeight(136);
QHBoxLayout * layout = new QHBoxLayout(itemWidget);

View File

@ -53,6 +53,7 @@ void HomePageItem::setupUi(const int& type, const QString& path) {
g_object_unref(desktopAppInfo);
break;
}
case SearchListView::ResType::Best:
case SearchListView::ResType::Content:
case SearchListView::ResType::Dir:
case SearchListView::ResType::File: {
@ -87,6 +88,7 @@ void HomePageItem::setupUi(const int& type, const QString& path) {
this->setToolTip(name);
break;
}
case SearchListView::ResType::Best :
case SearchListView::ResType::Content:
case SearchListView::ResType::Dir :
case SearchListView::ResType::File : {

View File

@ -307,6 +307,7 @@ bool SearchDetailView::openAction(const int& type, const QString& path) {
return true;
break;
}
case SearchListView::ResType::Best:
case SearchListView::ResType::Content:
case SearchListView::ResType::Dir:
case SearchListView::ResType::File: {