┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2022-10-19 18:03:12 +0200
committerFelix Ernst <[email protected]>2022-10-27 09:40:03 +0000
commit9478f1473006147c643c228793822b2eeb4b0606 (patch)
treed2a3d5adeba1a4052ccaa2ff6c3bd54672c4a5cd /src/views
parent3590619391ada4bc98182f385dcde605077383df (diff)
Make details view mode's full row activation optional
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ć <[email protected]> BUG: 453700 FIXED-IN: 22.12
Diffstat (limited to 'src/views')
-rw-r--r--src/views/dolphinitemlistview.cpp7
-rw-r--r--src/views/dolphinitemlistview.h3
2 files changed, 9 insertions, 1 deletions
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<DolphinFileItemListWidget>();
}
+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;