From 312af10f4f7aae13d953141ad9e2fb0180aebbef Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Wed, 29 Apr 2020 16:49:12 +0200 Subject: Allow coloring notes field. --- src/mainwindow.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 01d3e62c..8393d314 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3649,11 +3649,7 @@ void MainWindow::setColor_clicked() if (selection->hasSelection() && selection->selectedRows().count() > 1) { for (QModelIndex idx : selection->selectedRows()) { ModInfo::Ptr info = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt()); - auto flags = info->getFlags(); - if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_SEPARATOR) != flags.end()) - { - info->setColor(currentColor); - } + info->setColor(currentColor); } } else { @@ -3669,11 +3665,7 @@ void MainWindow::resetColor_clicked() if (selection->hasSelection() && selection->selectedRows().count() > 1) { for (QModelIndex idx : selection->selectedRows()) { ModInfo::Ptr info = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt()); - auto flags = info->getFlags(); - if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_SEPARATOR) != flags.end()) - { - info->setColor(color); - } + info->setColor(color); } } else { @@ -4774,6 +4766,13 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) menu.addSeparator(); + menu.addAction(tr("Select Color..."), this, SLOT(setColor_clicked())); + + if (info->getColor().isValid()) + menu.addAction(tr("Reset Color"), this, SLOT(resetColor_clicked())); + + menu.addSeparator(); + if (info->getNexusID() > 0 && Settings::instance().nexus().endorsementIntegration()) { switch (info->endorsedState()) { case ModInfo::ENDORSED_TRUE: { -- cgit v1.3.1 From 4d67365600383d739df5288612a347948d5506b3 Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Wed, 29 Apr 2020 17:04:25 +0200 Subject: Only show color context menu for mods when right clicking on Notes column. --- src/mainwindow.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8393d314..b5beb229 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4644,6 +4644,7 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) m_ContextIdx = mapToModel(m_OrganizerCore.modList(), modList->indexAt(pos)); m_ContextRow = m_ContextIdx.row(); + int contextColumn = m_ContextIdx.column(); if (m_ContextRow == -1) { // no selection @@ -4766,12 +4767,14 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) menu.addSeparator(); - menu.addAction(tr("Select Color..."), this, SLOT(setColor_clicked())); + if (contextColumn == ModList::COL_NOTES) { + menu.addAction(tr("Select Color..."), this, SLOT(setColor_clicked())); - if (info->getColor().isValid()) - menu.addAction(tr("Reset Color"), this, SLOT(resetColor_clicked())); + if (info->getColor().isValid()) + menu.addAction(tr("Reset Color"), this, SLOT(resetColor_clicked())); - menu.addSeparator(); + menu.addSeparator(); + } if (info->getNexusID() > 0 && Settings::instance().nexus().endorsementIntegration()) { switch (info->endorsedState()) { -- cgit v1.3.1