diff --git a/src/content-widget.cpp b/src/content-widget.cpp index de2cd3d..2a66263 100644 --- a/src/content-widget.cpp +++ b/src/content-widget.cpp @@ -346,6 +346,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); diff --git a/src/control/home-page-item.cpp b/src/control/home-page-item.cpp index 949a6de..8f386eb 100644 --- a/src/control/home-page-item.cpp +++ b/src/control/home-page-item.cpp @@ -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 : { diff --git a/src/control/search-detail-view.cpp b/src/control/search-detail-view.cpp index 3468a93..635781b 100644 --- a/src/control/search-detail-view.cpp +++ b/src/control/search-detail-view.cpp @@ -308,6 +308,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: {