diff options
| author | Al <26797547+Al12rs@users.noreply.github.com> | 2021-01-16 23:02:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-16 23:02:42 +0100 |
| commit | c48791a8a105d89cdbb8f4ac39557ed9cfd81800 (patch) | |
| tree | fb9aeb6aa05474dcad1a5fc9b21eb1af04f23778 /src/modlistview.cpp | |
| parent | 8ee1f94b0f695be46abce2f76ee96035e1d79df7 (diff) | |
| parent | 9f8ba0ea5196bccf73f2f26a3dc8a55907faa02f (diff) | |
Merge pull request #1361 from Holt59/ui-fixes-and-others
UI fixes and others.
Diffstat (limited to 'src/modlistview.cpp')
| -rw-r--r-- | src/modlistview.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/modlistview.cpp b/src/modlistview.cpp index ae905a6e..9f3a1266 100644 --- a/src/modlistview.cpp +++ b/src/modlistview.cpp @@ -214,6 +214,11 @@ Qt::SortOrder ModListView::sortOrder() const return m_sortProxy ? m_sortProxy->sortOrder() : Qt::AscendingOrder;
}
+bool ModListView::isFilterActive() const
+{
+ return m_sortProxy && m_sortProxy->isFilterActive();
+}
+
ModListView::GroupByMode ModListView::groupByMode() const
{
if (m_sortProxy == nullptr) {
@@ -295,16 +300,6 @@ std::optional<unsigned int> ModListView::prevMod(unsigned int modIndex) const return {};
}
-void ModListView::enableAllVisible()
-{
- m_core->modList()->setActive(indexViewToModel(flatIndex(model())), true);
-}
-
-void ModListView::disableAllVisible()
-{
- m_core->modList()->setActive(indexViewToModel(flatIndex(model())), false);
-}
-
void ModListView::setFilterCriteria(const std::vector<ModListSortProxy::Criteria>& criteria)
{
m_sortProxy->setCriteria(criteria);
@@ -792,7 +787,7 @@ void ModListView::setup(OrganizerCore& core, CategoryFactory& factory, MainWindo setItemDelegateForColumn(ModList::COL_FLAGS, new ModFlagIconDelegate(this, ModList::COL_FLAGS, 120));
setItemDelegateForColumn(ModList::COL_CONFLICTFLAGS, new ModConflictIconDelegate(this, ModList::COL_CONFLICTFLAGS, 80));
setItemDelegateForColumn(ModList::COL_CONTENT, new ModContentIconDelegate(this, ModList::COL_CONTENT, 150));
- setItemDelegateForColumn(ModList::COL_VERSION, new ModListVersionDelegate(this));
+ setItemDelegateForColumn(ModList::COL_VERSION, new ModListVersionDelegate(this, core.settings()));
if (m_core->settings().geometry().restoreState(header())) {
// hack: force the resize-signal to be triggered because restoreState doesn't seem to do that
@@ -1034,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)
@@ -1108,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;
@@ -1145,7 +1140,7 @@ std::vector<ModInfo::EFlag> ModListView::modFlags(const QModelIndex& index, bool bool compact = false;
if (info->isSeparator()
&& hasCollapsibleSeparators()
- && m_core->settings().interface().collapsibleSeparatorsConflicts()
+ && m_core->settings().interface().collapsibleSeparatorsIcons(ModList::COL_FLAGS)
&& !isExpanded(index.sibling(index.row(), 0))) {
// combine the child conflicts
@@ -1176,7 +1171,7 @@ std::vector<ModInfo::EConflictFlag> ModListView::conflictFlags(const QModelIndex bool compact = false;
if (info->isSeparator()
&& hasCollapsibleSeparators()
- && m_core->settings().interface().collapsibleSeparatorsConflicts()
+ && m_core->settings().interface().collapsibleSeparatorsIcons(ModList::COL_CONFLICTFLAGS)
&& !isExpanded(index.sibling(index.row(), 0))) {
// combine the child conflicts
@@ -1211,7 +1206,7 @@ std::set<int> ModListView::contents(const QModelIndex& index, bool* includeChild if (info->isSeparator()
&& hasCollapsibleSeparators()
- && m_core->settings().interface().collapsibleSeparatorsConflicts()
+ && m_core->settings().interface().collapsibleSeparatorsIcons(ModList::COL_CONTENT)
&& !isExpanded(index.sibling(index.row(), 0))) {
// combine the child contents
|
