From 38129e6e7760ffcb660de88e7b87e691e16a49df Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Thu, 14 Jan 2021 20:30:06 +0100 Subject: Disable highlighting from/to separators separately. --- src/modlistview.cpp | 7 +--- src/settings.cpp | 18 +++++++-- src/settings.h | 13 +++++-- src/settingsdialog.ui | 73 +++++++++++++++++++++++++++++-------- src/settingsdialoguserinterface.cpp | 9 +++-- 5 files changed, 89 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/modlistview.cpp b/src/modlistview.cpp index 63f38c46..9cc6d8b8 100644 --- a/src/modlistview.cpp +++ b/src/modlistview.cpp @@ -1029,7 +1029,7 @@ void ModListView::refreshMarkersAndPlugins() { QModelIndexList indexes = selectionModel()->selectedRows(); - if (m_core->settings().interface().collapsibleSeparatorsConflicts()) { + if (m_core->settings().interface().collapsibleSeparatorsHighlightFrom()) { for (auto& idx : selectionModel()->selectedRows()) { if (hasCollapsibleSeparators() && model()->hasChildren(idx) @@ -1103,7 +1103,7 @@ QColor ModListView::markerColor(const QModelIndex& index) const // collapsed separator auto rowIndex = index.sibling(index.row(), 0); if (hasCollapsibleSeparators() - && m_core->settings().interface().collapsibleSeparatorsConflicts() + && m_core->settings().interface().collapsibleSeparatorsHighlightTo() && model()->hasChildren(rowIndex) && !isExpanded(rowIndex)) { std::vector colors; @@ -1140,7 +1140,6 @@ std::vector ModListView::modFlags(const QModelIndex& index, bool bool compact = false; if (info->isSeparator() && hasCollapsibleSeparators() - && m_core->settings().interface().collapsibleSeparatorsConflicts() && !isExpanded(index.sibling(index.row(), 0))) { // combine the child conflicts @@ -1171,7 +1170,6 @@ std::vector ModListView::conflictFlags(const QModelIndex bool compact = false; if (info->isSeparator() && hasCollapsibleSeparators() - && m_core->settings().interface().collapsibleSeparatorsConflicts() && !isExpanded(index.sibling(index.row(), 0))) { // combine the child conflicts @@ -1206,7 +1204,6 @@ std::set ModListView::contents(const QModelIndex& index, bool* includeChild if (info->isSeparator() && hasCollapsibleSeparators() - && m_core->settings().interface().collapsibleSeparatorsConflicts() && !isExpanded(index.sibling(index.row(), 0))) { // combine the child contents diff --git a/src/settings.cpp b/src/settings.cpp index d1f3ef4f..4528d070 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -2188,14 +2188,24 @@ void InterfaceSettings::setCollapsibleSeparators(bool ascending, bool descending set(m_Settings, "Settings", "collapsible_separators_dsc", descending); } -bool InterfaceSettings::collapsibleSeparatorsConflicts() const +bool InterfaceSettings::collapsibleSeparatorsHighlightTo() const { - return get(m_Settings, "Settings", "collapsible_separators_conflicts", true); + return get(m_Settings, "Settings", "collapsible_separators_conflicts_to", true); } -void InterfaceSettings::setCollapsibleSeparatorsConflicts(bool b) +void InterfaceSettings::setCollapsibleSeparatorsHighlightTo(bool b) { - set(m_Settings, "Settings", "collapsible_separators_conflicts", b); + set(m_Settings, "Settings", "collapsible_separators_conflicts_to", b); +} + +bool InterfaceSettings::collapsibleSeparatorsHighlightFrom() const +{ + return get(m_Settings, "Settings", "collapsible_separators_conflicts_from", true); +} + +void InterfaceSettings::setCollapsibleSeparatorsHighlightFrom(bool b) +{ + set(m_Settings, "Settings", "collapsible_separators_conflicts_from", b); } bool InterfaceSettings::collapsibleSeparatorsPerProfile() const diff --git a/src/settings.h b/src/settings.h index 484ce163..e7ad7317 100644 --- a/src/settings.h +++ b/src/settings.h @@ -626,10 +626,17 @@ public: bool collapsibleSeparators(Qt::SortOrder order) const; void setCollapsibleSeparators(bool ascending, bool descending); - // whether to display mod conflicts on separators when collapsed + // whether to highlight mod conflicts and plugins on collapsed + // separators // - bool collapsibleSeparatorsConflicts() const; - void setCollapsibleSeparatorsConflicts(bool b); + bool collapsibleSeparatorsHighlightTo() const; + void setCollapsibleSeparatorsHighlightTo(bool b); + + // whether to highlight mod conflicts and plugins from separators + // when selected but collapsed + // + bool collapsibleSeparatorsHighlightFrom() const; + void setCollapsibleSeparatorsHighlightFrom(bool b); // whether each profile should have its own expansion state // diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index b23e6d90..25978865 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -366,22 +366,6 @@ If you disable this feature, MO will only display official DLCs this way. Please - - - - Display mod conflicts on and from separator when collapsed, and show plugins from collapsed separators. - - - Display mod conflicts on and from separator when collapsed, and show plugins from collapsed separators. - - - Show conflicts and plugins on separators and from separators - - - true - - - @@ -395,6 +379,63 @@ If you disable this feature, MO will only display official DLCs this way. Please + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Show conflicts and plugins + + + + + + + Highlight collapsed separators based on conflicts and plugins from mods inside them. + + + Highlight collapsed separators based on conflicts and plugins from mods inside them. + + + on separators + + + true + + + + + + + When selecting a collapsed separator, highlight conflicting mods and plugins from mods inside the separator. + + + When selecting a collapsed separator, highlight conflicting mods and plugins from mods inside the separator. + + + from separators + + + true + + + + + + diff --git a/src/settingsdialoguserinterface.cpp b/src/settingsdialoguserinterface.cpp index cdd30f2e..783c690f 100644 --- a/src/settingsdialoguserinterface.cpp +++ b/src/settingsdialoguserinterface.cpp @@ -19,7 +19,8 @@ UserInterfaceSettingsTab::UserInterfaceSettingsTab(Settings& s, SettingsDialog& // mod list ui->displayForeignBox->setChecked(settings().interface().displayForeign()); ui->colorSeparatorsBox->setChecked(settings().colors().colorSeparatorScrollbar()); - ui->collapsibleSeparatorsConflictsBox->setChecked(settings().interface().collapsibleSeparatorsConflicts()); + ui->collapsibleSeparatorsHighlightFromBox->setChecked(settings().interface().collapsibleSeparatorsHighlightFrom()); + ui->collapsibleSeparatorsHighlightToBox->setChecked(settings().interface().collapsibleSeparatorsHighlightTo()); ui->collapsibleSeparatorsAscBox->setChecked(settings().interface().collapsibleSeparators(Qt::AscendingOrder)); ui->collapsibleSeparatorsDscBox->setChecked(settings().interface().collapsibleSeparators(Qt::DescendingOrder)); ui->collapsibleSeparatorsPerProfileBox->setChecked(settings().interface().collapsibleSeparatorsPerProfile()); @@ -43,7 +44,8 @@ void UserInterfaceSettingsTab::update() settings().interface().setDisplayForeign(ui->displayForeignBox->isChecked()); settings().interface().setCollapsibleSeparators( ui->collapsibleSeparatorsAscBox->isChecked(), ui->collapsibleSeparatorsDscBox->isChecked()); - settings().interface().setCollapsibleSeparatorsConflicts(ui->collapsibleSeparatorsConflictsBox->isChecked()); + settings().interface().setCollapsibleSeparatorsHighlightFrom(ui->collapsibleSeparatorsHighlightFromBox->isChecked()); + settings().interface().setCollapsibleSeparatorsHighlightTo(ui->collapsibleSeparatorsHighlightToBox->isChecked()); settings().interface().setCollapsibleSeparatorsPerProfile(ui->collapsibleSeparatorsPerProfileBox->isChecked()); settings().interface().setSaveFilters(ui->saveFiltersBox->isChecked()); @@ -59,6 +61,7 @@ void UserInterfaceSettingsTab::updateCollapsibleSeparatorsGroup() { const auto checked = ui->collapsibleSeparatorsAscBox->isChecked() || ui->collapsibleSeparatorsDscBox->isChecked(); - ui->collapsibleSeparatorsConflictsBox->setEnabled(checked); + ui->collapsibleSeparatorsHighlightToBox->setEnabled(checked); + ui->collapsibleSeparatorsHighlightFromBox->setEnabled(checked); ui->collapsibleSeparatorsPerProfileBox->setEnabled(checked); } -- cgit v1.3.1