Skip to content

Commit

Permalink
Add header in context menu that shows only the file name
Browse files Browse the repository at this point in the history
  • Loading branch information
sakertooth committed Mar 2, 2025
1 parent 94b44f8 commit c7cb81f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/gui/FileBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,10 @@ void FileBrowserTreeWidget::contextMenuEvent(QContextMenuEvent* e)
{
case TypeFileItem: {
auto file = dynamic_cast<FileItem*>(item);
auto header = new QAction(file->text(0));

auto pathHeader = new QAction(file->fullName());
pathHeader->setDisabled(true);
contextMenu.addAction(pathHeader);
header->setDisabled(true);
contextMenu.addAction(header);

if (file->isTrack())
{
Expand All @@ -602,11 +602,10 @@ void FileBrowserTreeWidget::contextMenuEvent(QContextMenuEvent* e)
}
case TypeDirectoryItem: {
auto dir = dynamic_cast<Directory*>(item);
auto header = new QAction(dir->text(0));

auto pathHeader = new QAction(dir->fullName());
pathHeader->setDisabled(true);

contextMenu.addAction(pathHeader);
header->setDisabled(true);
contextMenu.addAction(header);

contextMenu.addAction(QIcon(embed::getIconPixmap("folder")), tr("Open in %1").arg(fileManager),
[=] { FileRevealer::openDir(dir->fullName()); });
Expand Down

0 comments on commit c7cb81f

Please sign in to comment.