From b651bf6fdc574c77e1faecc5f1c9559183bac80a Mon Sep 17 00:00:00 2001 From: Josip Medved Date: Sun, 11 Oct 2020 14:47:02 -0700 Subject: [PATCH] Added separator between root folders --- src/ui/mainwindow.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 39dbed3..d51157e 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -664,8 +664,14 @@ void MainWindow::onFolderMenuShow() { QFont italicFont = _folderButton->menu()->font(); italicFont.setItalic(true); + bool isFirst = true; _folderButton->menu()->clear(); for (FolderItem* folder : *_storage) { + if (isFirst) { + isFirst = false; + } else { + if (folder->isRoot()) { _folderButton->menu()->addSeparator(); } + } QAction* folderAction = new QAction(folder->title()); folderAction->setData(folder->name()); folderAction->setDisabled(folder == _folder); @@ -851,7 +857,13 @@ void MainWindow::onTabMenuRequested(const QPoint& point) { if (_storage->folderCount() > 1) { auto moveMenu = menu.addMenu("Move"); + bool isFirst = true; for (FolderItem* folder : *_storage) { + if (isFirst) { + isFirst = false; + } else { + if (folder->isRoot()) { moveMenu->addSeparator(); } + } auto folderAction = moveMenu->addAction(folder->title(), this, &MainWindow::onFolderMove); if (!folder->isPrimary()) { folderAction->setFont(italicFont); } folderAction->setData(folder->key());