diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-14 20:30:06 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-14 20:30:06 +0100 |
| commit | 38129e6e7760ffcb660de88e7b87e691e16a49df (patch) | |
| tree | 362a05389888648089d39604fecbbce3954ed5bb /src | |
| parent | 662a1eb3d7073166b1db3a05e34ecefd73046e3b (diff) | |
Disable highlighting from/to separators separately.
Diffstat (limited to 'src')
| -rw-r--r-- | src/modlistview.cpp | 7 | ||||
| -rw-r--r-- | src/settings.cpp | 18 | ||||
| -rw-r--r-- | src/settings.h | 13 | ||||
| -rw-r--r-- | src/settingsdialog.ui | 73 | ||||
| -rw-r--r-- | src/settingsdialoguserinterface.cpp | 9 |
5 files changed, 89 insertions, 31 deletions
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<QColor> colors;
@@ -1140,7 +1140,6 @@ std::vector<ModInfo::EFlag> 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<ModInfo::EConflictFlag> 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<int> 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<bool>(m_Settings, "Settings", "collapsible_separators_conflicts", true); + return get<bool>(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<bool>(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 @@ -367,22 +367,6 @@ If you disable this feature, MO will only display official DLCs this way. Please </widget> </item> <item> - <widget class="QCheckBox" name="collapsibleSeparatorsConflictsBox"> - <property name="toolTip"> - <string>Display mod conflicts on and from separator when collapsed, and show plugins from collapsed separators.</string> - </property> - <property name="whatsThis"> - <string>Display mod conflicts on and from separator when collapsed, and show plugins from collapsed separators.</string> - </property> - <property name="text"> - <string>Show conflicts and plugins on separators and from separators</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> <widget class="QCheckBox" name="collapsibleSeparatorsPerProfileBox"> <property name="toolTip"> <string>Do not share the collapse/expanded state of separators between profiles.</string> @@ -395,6 +379,63 @@ If you disable this feature, MO will only display official DLCs this way. Please </property> </widget> </item> + <item> + <widget class="QWidget" name="widget_9" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_12"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_34"> + <property name="text"> + <string>Show conflicts and plugins </string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="collapsibleSeparatorsHighlightToBox"> + <property name="toolTip"> + <string>Highlight collapsed separators based on conflicts and plugins from mods inside them.</string> + </property> + <property name="whatsThis"> + <string>Highlight collapsed separators based on conflicts and plugins from mods inside them.</string> + </property> + <property name="text"> + <string>on separators</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="collapsibleSeparatorsHighlightFromBox"> + <property name="toolTip"> + <string>When selecting a collapsed separator, highlight conflicting mods and plugins from mods inside the separator.</string> + </property> + <property name="whatsThis"> + <string>When selecting a collapsed separator, highlight conflicting mods and plugins from mods inside the separator.</string> + </property> + <property name="text"> + <string>from separators</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> </layout> </widget> </item> 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); } |
