From 9478f1473006147c643c228793822b2eeb4b0606 Mon Sep 17 00:00:00 2001 From: Felix Ernst Date: Wed, 19 Oct 2022 18:03:12 +0200 Subject: Make details view mode's full row activation optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In d3839617193e92463806580699caa595c892b8a6 the details view mode was changed in a way that made the full row of an item the click target instead of only having the item's icon and text be the representative clickable area of an item. This commit makes this new behaviour optional through a setting which can be changed in Dolphin's settings dialog. The explanation for introducing yet another setting in this case is as follows: While the introduced change is an improvement for many typical workflows, there are some workflows for which this new behaviour is problematic. Quite prominently a usage of Dolphin that tries to maximise information density is made worse by the change because now side padding is necessary to click the view's background. While the side padding is and was optional, disabling it made switching the active view in split view mode more difficult among other things. For a more complete discussion about the issues, please check out the bug report(s) and the discussion in Dolphin's gitlab issue with number 34. Co-authored-by: Ivan Čukić BUG: 453700 FIXED-IN: 22.12 --- src/views/dolphinitemlistview.cpp | 7 ++++++- src/views/dolphinitemlistview.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/views') diff --git a/src/views/dolphinitemlistview.cpp b/src/views/dolphinitemlistview.cpp index cd6dbd0a7..60d5577b8 100644 --- a/src/views/dolphinitemlistview.cpp +++ b/src/views/dolphinitemlistview.cpp @@ -83,7 +83,7 @@ void DolphinItemListView::readSettings() beginTransaction(); setEnabledSelectionToggles(m_selectionTogglesEnabled); - setHighlightEntireRow(DetailsModeSettings::sidePadding()); + setHighlightEntireRow(itemLayoutHighlightEntireRow(itemLayout())); setSupportsItemExpanding(itemLayoutSupportsItemExpanding(itemLayout())); updateFont(); @@ -107,6 +107,11 @@ KItemListWidgetCreatorBase* DolphinItemListView::defaultWidgetCreator() const return new KItemListWidgetCreator(); } +bool DolphinItemListView::itemLayoutHighlightEntireRow(ItemLayout layout) const +{ + return layout == DetailsLayout && DetailsModeSettings::highlightEntireRow(); +} + bool DolphinItemListView::itemLayoutSupportsItemExpanding(ItemLayout layout) const { return layout == DetailsLayout && DetailsModeSettings::expandableFolders(); diff --git a/src/views/dolphinitemlistview.h b/src/views/dolphinitemlistview.h index 464aec1b4..25476290f 100644 --- a/src/views/dolphinitemlistview.h +++ b/src/views/dolphinitemlistview.h @@ -47,6 +47,9 @@ public: protected: KItemListWidgetCreatorBase* defaultWidgetCreator() const override; + /** Overwriting in the Dolphin-specific class because we want this to be user-configurable. + * @see KStandardItemListView::itemLayoutHighlightEntireRow */ + bool itemLayoutHighlightEntireRow(ItemLayout layout) const override; bool itemLayoutSupportsItemExpanding(ItemLayout layout) const override; void onItemLayoutChanged(ItemLayout current, ItemLayout previous) override; void onPreviewsShownChanged(bool shown) override; -- cgit v1.3