fix: 修复全屏不能打开右键菜单问题

This commit is contained in:
hewenfei 2024-02-04 11:46:11 +08:00
parent 91819ccaef
commit f36b16229e
2 changed files with 4 additions and 4 deletions

View File

@ -92,8 +92,8 @@ ListView {
if (event.button === Qt.LeftButton) {
// openApplication
appManager.launchApp(id);
} else if (mouse.button === Qt.RightButton) {
// appListView.model.openMenu(index, MenuInfo.FullScreen);
} else if (event.button === Qt.RightButton) {
menuManager.showMenu(model.id, MenuInfo.FullScreen);
}
}
}

View File

@ -49,6 +49,7 @@ FavoriteContextMenu::actions(const DataEntity &data, QMenu *parent, const MenuIn
switch (location) {
case MenuInfo::AppList:
case MenuInfo::FullScreen:
case MenuInfo::FolderPage: {
if (data.favorite() == 0) {
list << new QAction(QObject::tr("Fix to favorite"), parent);
@ -79,7 +80,6 @@ FavoriteContextMenu::actions(const DataEntity &data, QMenu *parent, const MenuIn
appendActionsForAppsOutsideFolder(parent, data.id(), list);
break;
}
case MenuInfo::FullScreen:
case MenuInfo::Folder: {
appendActionsForAppsInFolder(parent, data.id(), list);
break;
@ -115,7 +115,7 @@ void FavoriteContextMenu::appendActionsForAppsOutsideFolder(QObject *parent, con
for (auto folder : FavoriteFolderHelper::instance()->folderData()) {
QString folderName = folder.getName();
int folderId = folder.getId();
QAction *subAction = new QAction(QObject::tr("Add to ").append(folderName), parent);
QAction *subAction = new QAction(QObject::tr("Add to \"%1\"").arg(folderName), parent);
QObject::connect(subAction, &QAction::triggered, parent, [appId, folderId] {
FavoritesModel::instance().addAppToFolder(appId, QString::number(folderId));
});