Merge pull request #134 from mammonsama666/homepage

fix(frontend): Recently opened files displayed incorrectly in homepage.
This commit is contained in:
iaom 2021-02-06 15:17:36 +08:00 committed by GitHub
commit 133a36ebe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View File

@ -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);

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

@ -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: {