summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAl <26797547+Al12rs@users.noreply.github.com>2020-04-30 15:57:42 +0200
committerGitHub <noreply@github.com>2020-04-30 15:57:42 +0200
commit4b265a5cd381168f73c156227c473a0ac55bb476 (patch)
treec9845642b6f048fa80edbc38285d78ee3bf0c3fa /src/mainwindow.cpp
parent9945beabf160c68852a8bdac07de255f04fd6886 (diff)
parentbdd1e97d4f3a8b294a0691a7631c60cf24fffa90 (diff)
Merge pull request #1063 from Al12rs/mod_colors
Mod colors
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 01d3e62c..b5beb229 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 {
@@ -4652,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
@@ -4774,6 +4767,15 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos)
menu.addSeparator();
+ 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()));
+
+ menu.addSeparator();
+ }
+
if (info->getNexusID() > 0 && Settings::instance().nexus().endorsementIntegration()) {
switch (info->endorsedState()) {
case ModInfo::ENDORSED_TRUE: {