From edda24eb851c2647f7dde01885008ef60fcadd9a Mon Sep 17 00:00:00 2001 From: Victor Blanchard Date: Wed, 28 May 2025 12:33:52 +0200 Subject: dolphinview: Add a dynamic view option Added a 'dynamic view' option, which allows to switch from a 'compact' or 'details' view to an 'icons' view if most of the files in the directory are images or videos. It reverts to the previous view mode when we switch to a directory which doesn't meet that criteria. The view mode is only changed once so users don't have to undo that for specific folders when they don't want icon view. A setting is added in the "Display style" section of the general view setting page. BUG: 491139 --- src/views/viewproperties.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/views/viewproperties.cpp') diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index 5dbdd938e..8e09009e5 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -369,6 +369,19 @@ bool ViewProperties::sortHiddenLast() const return m_node->sortHiddenLast(); } +void ViewProperties::setDynamicViewPassed(bool dynamicViewPassed) +{ + if (m_node->dynamicViewPassed() != dynamicViewPassed) { + m_node->setDynamicViewPassed(dynamicViewPassed); + update(); + } +} + +bool ViewProperties::dynamicViewPassed() const +{ + return m_node->dynamicViewPassed(); +} + void ViewProperties::setVisibleRoles(const QList &roles) { if (roles == visibleRoles()) { -- cgit v1.3