diff --git a/README_zh.md b/README_zh.md index f7d5855a..046d2a1b 100644 --- a/README_zh.md +++ b/README_zh.md @@ -46,7 +46,7 @@ sudo zypper in vnote 由于 Leap 42 及以下版本的 Qt 版本过低,我们无法在 OBS 上进行打包。请使用 AppImage 或自行构建。 ### Arch Linux -Arch Linux可以通过AUR中的 [vnote-git](https://aur.archlinux.org/packages/vnote/) 进行安装: +Arch Linux可以通过AUR中的 [vnote](https://aur.archlinux.org/packages/vnote/) 进行安装: ```shell git clone https://aur.archlinux.org/vnote.git diff --git a/src/resources/icons/note_item.svg b/src/resources/icons/note_item.svg index b7e13b74..411ae214 100644 --- a/src/resources/icons/note_item.svg +++ b/src/resources/icons/note_item.svg @@ -3,13 +3,8 @@ - - - + diff --git a/src/vdirectorytree.cpp b/src/vdirectorytree.cpp index c53f5a4d..16f048b0 100644 --- a/src/vdirectorytree.cpp +++ b/src/vdirectorytree.cpp @@ -35,7 +35,6 @@ VDirectoryTree::VDirectoryTree(QWidget *parent) setContextMenuPolicy(Qt::CustomContextMenu); initShortcuts(); - initActions(); connect(this, SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(handleItemExpanded(QTreeWidgetItem*))); @@ -88,85 +87,6 @@ void VDirectoryTree::initShortcuts() } } -void VDirectoryTree::initActions() -{ - m_newNoteAct = new QAction(VIconUtils::menuIcon(":/resources/icons/create_note_tb.svg"), - tr("New &Note"), this); - VUtils::fixTextWithShortcut(m_newNoteAct, "NewNote"); - m_newNoteAct->setToolTip(tr("Create a note in selected folder")); - connect(m_newNoteAct, &QAction::triggered, - this, [this]() { - g_mainWin->getFileList()->newFile(); - }); - - newRootDirAct = new QAction(VIconUtils::menuIcon(":/resources/icons/create_rootdir.svg"), - tr("New &Root Folder"), this); - newRootDirAct->setToolTip(tr("Create a root folder in current notebook")); - connect(newRootDirAct, &QAction::triggered, - this, &VDirectoryTree::newRootDirectory); - - newSubDirAct = new QAction(VIconUtils::menuIcon(":/resources/icons/create_subdir.svg"), - tr("New &Subfolder"), this); - newSubDirAct->setToolTip(tr("Create a subfolder")); - VUtils::fixTextWithShortcut(newSubDirAct, "NewSubfolder"); - connect(newSubDirAct, &QAction::triggered, - this, &VDirectoryTree::newSubDirectory); - - deleteDirAct = new QAction(VIconUtils::menuDangerIcon(":/resources/icons/delete_dir.svg"), - tr("&Delete"), this); - deleteDirAct->setToolTip(tr("Delete selected folder")); - connect(deleteDirAct, &QAction::triggered, - this, &VDirectoryTree::deleteSelectedDirectory); - - dirInfoAct = new QAction(VIconUtils::menuIcon(":/resources/icons/dir_info.svg"), - tr("&Info\t%1").arg(VUtils::getShortcutText(c_infoShortcutSequence)), this); - dirInfoAct->setToolTip(tr("View and edit current folder's information")); - connect(dirInfoAct, &QAction::triggered, - this, &VDirectoryTree::editDirectoryInfo); - - copyAct = new QAction(VIconUtils::menuIcon(":/resources/icons/copy.svg"), - tr("&Copy\t%1").arg(VUtils::getShortcutText(c_copyShortcutSequence)), this); - copyAct->setToolTip(tr("Copy selected folders")); - connect(copyAct, &QAction::triggered, - this, &VDirectoryTree::copySelectedDirectories); - - cutAct = new QAction(VIconUtils::menuIcon(":/resources/icons/cut.svg"), - tr("C&ut\t%1").arg(VUtils::getShortcutText(c_cutShortcutSequence)), this); - cutAct->setToolTip(tr("Cut selected folders")); - connect(cutAct, &QAction::triggered, - this, &VDirectoryTree::cutSelectedDirectories); - - pasteAct = new QAction(VIconUtils::menuIcon(":/resources/icons/paste.svg"), - tr("&Paste\t%1").arg(VUtils::getShortcutText(c_pasteShortcutSequence)), this); - pasteAct->setToolTip(tr("Paste folders in this folder")); - connect(pasteAct, &QAction::triggered, - this, &VDirectoryTree::pasteDirectoriesFromClipboard); - - m_openLocationAct = new QAction(tr("&Open Folder Location"), this); - m_openLocationAct->setToolTip(tr("Open the folder containing this folder in operating system")); - connect(m_openLocationAct, &QAction::triggered, - this, &VDirectoryTree::openDirectoryLocation); - - m_pinToHistoryAct = new QAction(VIconUtils::menuIcon(":/resources/icons/pin.svg"), - tr("Pin To History"), - this); - m_pinToHistoryAct->setToolTip(tr("Pin selected folder to History")); - connect(m_pinToHistoryAct, &QAction::triggered, - this, &VDirectoryTree::pinDirectoryToHistory); - - m_reloadAct = new QAction(tr("&Reload From Disk"), this); - m_reloadAct->setToolTip(tr("Reload the content of this folder (or notebook) from disk")); - connect(m_reloadAct, &QAction::triggered, - this, &VDirectoryTree::reloadFromDisk); - - m_sortAct = new QAction(VIconUtils::menuIcon(":/resources/icons/sort.svg"), - tr("&Sort"), - this); - m_sortAct->setToolTip(tr("Sort folders in this folder/notebook manually")); - connect(m_sortAct, SIGNAL(triggered(bool)), - this, SLOT(sortItems())); -} - void VDirectoryTree::setNotebook(VNotebook *p_notebook) { if (m_notebook == p_notebook) { @@ -396,23 +316,54 @@ void VDirectoryTree::contextMenuRequested(QPoint pos) QMenu menu(this); menu.setToolTipsVisible(true); + QAction *newRootDirAct = new QAction(VIconUtils::menuIcon(":/resources/icons/create_rootdir.svg"), + tr("New &Root Folder"), + &menu); + newRootDirAct->setToolTip(tr("Create a root folder in current notebook")); + connect(newRootDirAct, &QAction::triggered, + this, &VDirectoryTree::newRootDirectory); + + QAction *sortAct = new QAction(VIconUtils::menuIcon(":/resources/icons/sort.svg"), + tr("&Sort"), + &menu); + sortAct->setToolTip(tr("Sort folders in this folder/notebook manually")); + connect(sortAct, SIGNAL(triggered(bool)), + this, SLOT(sortItems())); + if (!item) { // Context menu on the free space of the QTreeWidget menu.addAction(newRootDirAct); if (topLevelItemCount() > 1) { - menu.addAction(m_sortAct); + menu.addAction(sortAct); } } else { // Context menu on a QTreeWidgetItem - menu.addAction(m_newNoteAct); + QAction *newNoteAct = new QAction(VIconUtils::menuIcon(":/resources/icons/create_note_tb.svg"), + tr("New &Note"), + &menu); + VUtils::fixTextWithShortcut(newNoteAct, "NewNote"); + newNoteAct->setToolTip(tr("Create a note in selected folder")); + connect(newNoteAct, &QAction::triggered, + this, [this]() { + g_mainWin->getFileList()->newFile(); + }); + menu.addAction(newNoteAct); + + QAction *newSubDirAct = new QAction(VIconUtils::menuIcon(":/resources/icons/create_subdir.svg"), + tr("New &Subfolder"), + &menu); + newSubDirAct->setToolTip(tr("Create a subfolder")); + VUtils::fixTextWithShortcut(newSubDirAct, "NewSubfolder"); + connect(newSubDirAct, &QAction::triggered, + this, &VDirectoryTree::newSubDirectory); if (item->parent()) { // Low-level item menu.addAction(newSubDirAct); if (item->parent()->childCount() > 1) { - menu.addAction(m_sortAct); + menu.addAction(sortAct); } } else { // Top-level item @@ -420,13 +371,34 @@ void VDirectoryTree::contextMenuRequested(QPoint pos) menu.addAction(newSubDirAct); if (topLevelItemCount() > 1) { - menu.addAction(m_sortAct); + menu.addAction(sortAct); } } menu.addSeparator(); + + QAction *deleteDirAct = new QAction(VIconUtils::menuDangerIcon(":/resources/icons/delete_dir.svg"), + tr("&Delete"), + &menu); + deleteDirAct->setToolTip(tr("Delete selected folder")); + connect(deleteDirAct, &QAction::triggered, + this, &VDirectoryTree::deleteSelectedDirectory); menu.addAction(deleteDirAct); + + QAction *copyAct = new QAction(VIconUtils::menuIcon(":/resources/icons/copy.svg"), + tr("&Copy\t%1").arg(VUtils::getShortcutText(c_copyShortcutSequence)), + &menu); + copyAct->setToolTip(tr("Copy selected folders")); + connect(copyAct, &QAction::triggered, + this, &VDirectoryTree::copySelectedDirectories); menu.addAction(copyAct); + + QAction *cutAct = new QAction(VIconUtils::menuIcon(":/resources/icons/cut.svg"), + tr("C&ut\t%1").arg(VUtils::getShortcutText(c_cutShortcutSequence)), + &menu); + cutAct->setToolTip(tr("Cut selected folders")); + connect(cutAct, &QAction::triggered, + this, &VDirectoryTree::cutSelectedDirectories); menu.addAction(cutAct); } @@ -435,15 +407,44 @@ void VDirectoryTree::contextMenuRequested(QPoint pos) menu.addSeparator(); } + QAction *pasteAct = new QAction(VIconUtils::menuIcon(":/resources/icons/paste.svg"), + tr("&Paste\t%1").arg(VUtils::getShortcutText(c_pasteShortcutSequence)), + &menu); + pasteAct->setToolTip(tr("Paste folders in this folder")); + connect(pasteAct, &QAction::triggered, + this, &VDirectoryTree::pasteDirectoriesFromClipboard); menu.addAction(pasteAct); } menu.addSeparator(); - menu.addAction(m_reloadAct); + + QAction *reloadAct = new QAction(tr("&Reload From Disk"), &menu); + reloadAct->setToolTip(tr("Reload the content of this folder (or notebook) from disk")); + connect(reloadAct, &QAction::triggered, + this, &VDirectoryTree::reloadFromDisk); + menu.addAction(reloadAct); if (item) { - menu.addAction(m_openLocationAct); - menu.addAction(m_pinToHistoryAct); + QAction *openLocationAct = new QAction(tr("&Open Folder Location"), &menu); + openLocationAct->setToolTip(tr("Open the folder containing this folder in operating system")); + connect(openLocationAct, &QAction::triggered, + this, &VDirectoryTree::openDirectoryLocation); + menu.addAction(openLocationAct); + + QAction *pinToHistoryAct = new QAction(VIconUtils::menuIcon(":/resources/icons/pin.svg"), + tr("Pin To History"), + &menu); + pinToHistoryAct->setToolTip(tr("Pin selected folder to History")); + connect(pinToHistoryAct, &QAction::triggered, + this, &VDirectoryTree::pinDirectoryToHistory); + menu.addAction(pinToHistoryAct); + + QAction *dirInfoAct = new QAction(VIconUtils::menuIcon(":/resources/icons/dir_info.svg"), + tr("&Info\t%1").arg(VUtils::getShortcutText(c_infoShortcutSequence)), + &menu); + dirInfoAct->setToolTip(tr("View and edit current folder's information")); + connect(dirInfoAct, &QAction::triggered, + this, &VDirectoryTree::editDirectoryInfo); menu.addAction(dirInfoAct); } diff --git a/src/vdirectorytree.h b/src/vdirectorytree.h index c7e3ba24..f2a9a03f 100644 --- a/src/vdirectorytree.h +++ b/src/vdirectorytree.h @@ -113,8 +113,6 @@ private: void initShortcuts(); - void initActions(); - // Update @p_item's direct children only: deleted, added, renamed. void updateItemDirectChildren(QTreeWidgetItem *p_item); @@ -166,25 +164,6 @@ private: // Magic number for clipboard operations. int m_magicForClipboard; - // Actions - QAction *m_newNoteAct; - - QAction *newRootDirAct; - - QAction *newSubDirAct; - - QAction *deleteDirAct; - QAction *dirInfoAct; - QAction *copyAct; - QAction *cutAct; - QAction *pasteAct; - QAction *m_openLocationAct; - QAction *m_pinToHistoryAct; - QAction *m_sortAct; - - // Reload content from disk. - QAction *m_reloadAct; - static const QString c_infoShortcutSequence; static const QString c_copyShortcutSequence; static const QString c_cutShortcutSequence; diff --git a/src/vfilelist.cpp b/src/vfilelist.cpp index 401aff4c..6d31cc84 100644 --- a/src/vfilelist.cpp +++ b/src/vfilelist.cpp @@ -34,12 +34,12 @@ const QString VFileList::c_pasteShortcutSequence = "Ctrl+V"; VFileList::VFileList(QWidget *parent) : QWidget(parent), VNavigationMode(), + m_openWithMenu(NULL), m_itemClicked(NULL), m_fileToCloseInSingleClick(NULL) { setupUI(); initShortcuts(); - initActions(); m_clickTimer = new QTimer(this); m_clickTimer->setSingleShot(true); @@ -125,96 +125,6 @@ void VFileList::initShortcuts() }); } -void VFileList::initActions() -{ - newFileAct = new QAction(VIconUtils::menuIcon(":/resources/icons/create_note.svg"), - tr("&New Note"), this); - VUtils::fixTextWithShortcut(newFileAct, "NewNote"); - newFileAct->setToolTip(tr("Create a note in current folder")); - connect(newFileAct, SIGNAL(triggered(bool)), - this, SLOT(newFile())); - - m_openInReadAct = new QAction(VIconUtils::menuIcon(":/resources/icons/reading.svg"), - tr("&Open In Read Mode"), this); - m_openInReadAct->setToolTip(tr("Open current note in read mode")); - connect(m_openInReadAct, &QAction::triggered, - this, [this]() { - QListWidgetItem *item = fileList->currentItem(); - if (item) { - emit fileClicked(getVFile(item), OpenFileMode::Read, true); - } - }); - - m_openInEditAct = new QAction(VIconUtils::menuIcon(":/resources/icons/editing.svg"), - tr("Open In &Edit Mode"), this); - m_openInEditAct->setToolTip(tr("Open current note in edit mode")); - connect(m_openInEditAct, &QAction::triggered, - this, [this]() { - QListWidgetItem *item = fileList->currentItem(); - if (item) { - emit fileClicked(getVFile(item), OpenFileMode::Edit, true); - } - }); - - deleteFileAct = new QAction(VIconUtils::menuDangerIcon(":/resources/icons/delete_note.svg"), - tr("&Delete"), this); - deleteFileAct->setToolTip(tr("Delete selected note")); - connect(deleteFileAct, SIGNAL(triggered(bool)), - this, SLOT(deleteSelectedFiles())); - - fileInfoAct = new QAction(VIconUtils::menuIcon(":/resources/icons/note_info.svg"), - tr("&Info\t%1").arg(VUtils::getShortcutText(c_infoShortcutSequence)), this); - fileInfoAct->setToolTip(tr("View and edit current note's information")); - connect(fileInfoAct, SIGNAL(triggered(bool)), - this, SLOT(fileInfo())); - - copyAct = new QAction(VIconUtils::menuIcon(":/resources/icons/copy.svg"), - tr("&Copy\t%1").arg(VUtils::getShortcutText(c_copyShortcutSequence)), this); - copyAct->setToolTip(tr("Copy selected notes")); - connect(copyAct, &QAction::triggered, - this, &VFileList::copySelectedFiles); - - cutAct = new QAction(VIconUtils::menuIcon(":/resources/icons/cut.svg"), - tr("C&ut\t%1").arg(VUtils::getShortcutText(c_cutShortcutSequence)), this); - cutAct->setToolTip(tr("Cut selected notes")); - connect(cutAct, &QAction::triggered, - this, &VFileList::cutSelectedFiles); - - pasteAct = new QAction(VIconUtils::menuIcon(":/resources/icons/paste.svg"), - tr("&Paste\t%1").arg(VUtils::getShortcutText(c_pasteShortcutSequence)), this); - pasteAct->setToolTip(tr("Paste notes in current folder")); - connect(pasteAct, &QAction::triggered, - this, &VFileList::pasteFilesFromClipboard); - - m_openLocationAct = new QAction(tr("&Open Note Location"), this); - m_openLocationAct->setToolTip(tr("Open the folder containing this note in operating system")); - connect(m_openLocationAct, &QAction::triggered, - this, &VFileList::openFileLocation); - - m_addToCartAct = new QAction(VIconUtils::menuIcon(":/resources/icons/cart.svg"), - tr("Add To Cart"), - this); - m_addToCartAct->setToolTip(tr("Add selected notes to Cart for further processing")); - connect(m_addToCartAct, &QAction::triggered, - this, &VFileList::addFileToCart); - - m_pinToHistoryAct = new QAction(VIconUtils::menuIcon(":/resources/icons/pin.svg"), - tr("Pin To History"), - this); - m_pinToHistoryAct->setToolTip(tr("Pin selected notes to History")); - connect(m_pinToHistoryAct, &QAction::triggered, - this, &VFileList::pinFileToHistory); - - m_sortAct = new QAction(VIconUtils::menuIcon(":/resources/icons/sort.svg"), - tr("&Sort"), - this); - m_sortAct->setToolTip(tr("Sort notes in this folder manually")); - connect(m_sortAct, &QAction::triggered, - this, &VFileList::sortItems); - - initOpenWithMenu(); -} - void VFileList::setDirectory(VDirectory *p_directory) { // QPointer will be set to NULL automatically once the directory was deleted. @@ -610,25 +520,83 @@ void VFileList::contextMenuRequested(QPoint pos) VNoteFile *file = getVFile(item); if (file) { if (file->getDocType() == DocType::Markdown) { - menu.addAction(m_openInReadAct); - menu.addAction(m_openInEditAct); + QAction *openInReadAct = new QAction(VIconUtils::menuIcon(":/resources/icons/reading.svg"), + tr("&Open In Read Mode"), + &menu); + openInReadAct->setToolTip(tr("Open current note in read mode")); + connect(openInReadAct, &QAction::triggered, + this, [this]() { + QListWidgetItem *item = fileList->currentItem(); + if (item) { + emit fileClicked(getVFile(item), OpenFileMode::Read, true); + } + }); + menu.addAction(openInReadAct); + + QAction *openInEditAct = new QAction(VIconUtils::menuIcon(":/resources/icons/editing.svg"), + tr("Open In &Edit Mode"), + &menu); + openInEditAct->setToolTip(tr("Open current note in edit mode")); + connect(openInEditAct, &QAction::triggered, + this, [this]() { + QListWidgetItem *item = fileList->currentItem(); + if (item) { + emit fileClicked(getVFile(item), OpenFileMode::Edit, true); + } + }); + menu.addAction(openInEditAct); } - menu.addMenu(m_openWithMenu); + menu.addMenu(getOpenWithMenu()); + menu.addSeparator(); } } + QAction *newFileAct = new QAction(VIconUtils::menuIcon(":/resources/icons/create_note.svg"), + tr("&New Note"), + &menu); + VUtils::fixTextWithShortcut(newFileAct, "NewNote"); + newFileAct->setToolTip(tr("Create a note in current folder")); + connect(newFileAct, SIGNAL(triggered(bool)), + this, SLOT(newFile())); menu.addAction(newFileAct); if (fileList->count() > 1) { - menu.addAction(m_sortAct); + QAction *sortAct = new QAction(VIconUtils::menuIcon(":/resources/icons/sort.svg"), + tr("&Sort"), + &menu); + sortAct->setToolTip(tr("Sort notes in this folder manually")); + connect(sortAct, &QAction::triggered, + this, &VFileList::sortItems); + menu.addAction(sortAct); } if (item) { menu.addSeparator(); + + QAction *deleteFileAct = new QAction(VIconUtils::menuDangerIcon(":/resources/icons/delete_note.svg"), + tr("&Delete"), + &menu); + deleteFileAct->setToolTip(tr("Delete selected note")); + connect(deleteFileAct, SIGNAL(triggered(bool)), + this, SLOT(deleteSelectedFiles())); menu.addAction(deleteFileAct); + + QAction *copyAct = new QAction(VIconUtils::menuIcon(":/resources/icons/copy.svg"), + tr("&Copy\t%1").arg(VUtils::getShortcutText(c_copyShortcutSequence)), + &menu); + copyAct->setToolTip(tr("Copy selected notes")); + connect(copyAct, &QAction::triggered, + this, &VFileList::copySelectedFiles); menu.addAction(copyAct); + + QAction *cutAct = new QAction(VIconUtils::menuIcon(":/resources/icons/cut.svg"), + tr("C&ut\t%1").arg(VUtils::getShortcutText(c_cutShortcutSequence)), + &menu); + cutAct->setToolTip(tr("Cut selected notes")); + connect(cutAct, &QAction::triggered, + this, &VFileList::cutSelectedFiles); menu.addAction(cutAct); } @@ -637,19 +605,48 @@ void VFileList::contextMenuRequested(QPoint pos) menu.addSeparator(); } + QAction *pasteAct = new QAction(VIconUtils::menuIcon(":/resources/icons/paste.svg"), + tr("&Paste\t%1").arg(VUtils::getShortcutText(c_pasteShortcutSequence)), + &menu); + pasteAct->setToolTip(tr("Paste notes in current folder")); + connect(pasteAct, &QAction::triggered, + this, &VFileList::pasteFilesFromClipboard); menu.addAction(pasteAct); } if (item) { menu.addSeparator(); if (selectedSize == 1) { - menu.addAction(m_openLocationAct); + QAction *openLocationAct = new QAction(tr("&Open Note Location"), &menu); + openLocationAct->setToolTip(tr("Open the folder containing this note in operating system")); + connect(openLocationAct, &QAction::triggered, + this, &VFileList::openFileLocation); + menu.addAction(openLocationAct); } - menu.addAction(m_addToCartAct); - menu.addAction(m_pinToHistoryAct); + QAction *addToCartAct = new QAction(VIconUtils::menuIcon(":/resources/icons/cart.svg"), + tr("Add To Cart"), + &menu); + addToCartAct->setToolTip(tr("Add selected notes to Cart for further processing")); + connect(addToCartAct, &QAction::triggered, + this, &VFileList::addFileToCart); + menu.addAction(addToCartAct); + + QAction *pinToHistoryAct = new QAction(VIconUtils::menuIcon(":/resources/icons/pin.svg"), + tr("Pin To History"), + &menu); + pinToHistoryAct->setToolTip(tr("Pin selected notes to History")); + connect(pinToHistoryAct, &QAction::triggered, + this, &VFileList::pinFileToHistory); + menu.addAction(pinToHistoryAct); if (selectedSize == 1) { + QAction *fileInfoAct = new QAction(VIconUtils::menuIcon(":/resources/icons/note_info.svg"), + tr("&Info\t%1").arg(VUtils::getShortcutText(c_infoShortcutSequence)), + &menu); + fileInfoAct->setToolTip(tr("View and edit current note's information")); + connect(fileInfoAct, SIGNAL(triggered(bool)), + this, SLOT(fileInfo())); menu.addAction(fileInfoAct); } } @@ -1151,8 +1148,12 @@ void VFileList::sortItems() } } -void VFileList::initOpenWithMenu() +QMenu *VFileList::getOpenWithMenu() { + if (m_openWithMenu) { + return m_openWithMenu; + } + m_openWithMenu = new QMenu(tr("Open With"), this); m_openWithMenu->setToolTipsVisible(true); @@ -1240,6 +1241,8 @@ void VFileList::initOpenWithMenu() }); m_openWithMenu->addAction(addAct); + + return m_openWithMenu; } void VFileList::handleOpenWithActionTriggered() diff --git a/src/vfilelist.h b/src/vfilelist.h index 76f6d873..dfb2a12e 100644 --- a/src/vfilelist.h +++ b/src/vfilelist.h @@ -136,9 +136,6 @@ private: // Remove and delete item related to @p_file from list widget. void removeFileListItem(VNoteFile *p_file); - // Init actions. - void initActions(); - // Return the corresponding QListWidgetItem of @p_file. QListWidgetItem *findItem(const VNoteFile *p_file); @@ -164,8 +161,7 @@ private: // Check if there are files in clipboard available to paste. bool pasteAvailable() const; - // Init Open With menu. - void initOpenWithMenu(); + QMenu *getOpenWithMenu(); void activateItem(QListWidgetItem *p_item, bool p_restoreFocus = false); @@ -182,24 +178,6 @@ private: // Magic number for clipboard operations. int m_magicForClipboard; - // Actions - QAction *m_openInReadAct; - QAction *m_openInEditAct; - QAction *newFileAct; - QAction *deleteFileAct; - QAction *fileInfoAct; - QAction *copyAct; - QAction *cutAct; - QAction *pasteAct; - - QAction *m_openLocationAct; - - QAction *m_sortAct; - - QAction *m_addToCartAct; - - QAction *m_pinToHistoryAct; - // Context sub-menu of Open With. QMenu *m_openWithMenu; diff --git a/src/vhistorylist.cpp b/src/vhistorylist.cpp index 67f4b646..a3b9d6db 100644 --- a/src/vhistorylist.cpp +++ b/src/vhistorylist.cpp @@ -264,6 +264,7 @@ void VHistoryList::updateList() m_itemList->addItem(seps[i].m_item); } + QIcon noteIcon(VIconUtils::treeViewIcon(":/resources/icons/note_item.svg")); QIcon folderIcon(VIconUtils::treeViewIcon(":/resources/icons/dir_item.svg")); for (auto it = m_histories.cbegin(); it != m_histories.cend(); ++it) { QListWidgetItem *item = new QListWidgetItem(VUtils::fileNameFromPath(it->m_file)); @@ -272,6 +273,8 @@ void VHistoryList::updateList() if (it->m_isFolder) { item->setIcon(folderIcon); + } else { + item->setIcon(noteIcon); } if (it->m_isPinned) {