summaryrefslogtreecommitdiff
path: root/src/modlistcontextmenu.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2021-01-14 19:54:13 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-14 19:54:13 +0100
commit2c9a3c7de874a5edfdc6dacf2fd2fcd7f303152d (patch)
treeba52f8b8d361f283a0ab04d324e0b30b64582f94 /src/modlistcontextmenu.cpp
parent899308b31d541e78a3e4395bf33cd66c5ec4f769 (diff)
Better context menu entries for mod/separator creation.
Diffstat (limited to 'src/modlistcontextmenu.cpp')
-rw-r--r--src/modlistcontextmenu.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/modlistcontextmenu.cpp b/src/modlistcontextmenu.cpp
index 97eef0eb..ac5494da 100644
--- a/src/modlistcontextmenu.cpp
+++ b/src/modlistcontextmenu.cpp
@@ -20,17 +20,23 @@ ModListGlobalContextMenu::ModListGlobalContextMenu(OrganizerCore& core, ModListV
addAction(tr("Install Mod..."), [=]() { view->actions().installMod(); });
auto modIndex = index.data(ModList::IndexRole);
- if (modIndex.isValid()) {
+ if (modIndex.isValid() && view->sortColumn() == ModList::COL_PRIORITY) {
auto info = ModInfo::getByIndex(modIndex.toInt());
if (!info->isBackup()) {
- addAction(info->isSeparator() ? tr("Create empty mod inside") : tr("Create empty mod before"),
- [=]() { view->actions().createEmptyMod(index); });
- addAction(tr("Create separator before"), [=]() { view->actions().createSeparator(index); });
+ QString text = tr("Create empty mod above");
+ if (info->isSeparator()) {
+ text = tr("Create empty mod inside");
+ }
+ else if (view->sortOrder() == Qt::DescendingOrder) {
+ text = tr("Create empty mod below");
+ }
+ addAction(text, [=]() { view->actions().createEmptyMod(index); });
+ addAction(tr("Create separator above"), [=]() { view->actions().createSeparator(index); });
}
}
else {
- addAction(tr("Create empty mod at the end"), [=]() { view->actions().createEmptyMod(); });
- addAction(tr("Create separator at the end"), [=]() { view->actions().createSeparator(); });
+ addAction(tr("Create empty mod"), [=]() { view->actions().createEmptyMod(); });
+ addAction(tr("Create separator"), [=]() { view->actions().createSeparator(); });
}
if (view->hasCollapsibleSeparators()) {