From 3bf471e02a440bd008d69c5939b7c5bf2c03df54 Mon Sep 17 00:00:00 2001 From: Felix Ernst Date: Fri, 8 Apr 2022 11:07:23 +0200 Subject: [PATCH] Add symmetric padding on right side of details view There have been some reports that users were unable to figure out that the padding on the left of the left-most "name" column can be used for deselecting or for dropping file items. All of these reports were by people using a Dolphin version in which that padding was way too narrow because of a regression (that has since been fixed). Nonetheless this highlights the potential problem that some users might be unable to notice/figure out the usefulness of the left padding. This commit adds a similar area on the right side of the view when the column widths are set automatically by Dolphin. The width of the right padding column mirrors the width of the left padding column when sized automatically. Both can manually be hidden or resized similarly to resizing other columns. There are various usability advantages to having this padding by default on both sides of the view and not only on the left: - The right margin is more discoverable since the item highlight ends right before the padding column - Less mouse travel time to reach either of the areas - More than double the likelihood of users figuring out the advantages of these padding areas for deselecting or dropping - More visual symmetry I had suggested also having this kind of right padding even before the initial implementation of the left padding. The contributor implementing it was in favour of it. It only wasn't implemented because the contributor said it was impossible without a lot of work. Turns out adding two characters at the right position seems to suffice in most ways. This commit does not contain the string change of renaming "Leading Column Padding" to "Column Padding" (since it changes two paddings now) to not infringe on the string freeze. BUG: 452273 --- src/kitemviews/kitemlistview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 239e399a45..77114735ba 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -2405,7 +2405,9 @@ void KItemListView::applyAutomaticColumnWidths() qreal firstColumnWidth = m_headerWidget->columnWidth(firstRole); QSizeF dynamicItemSize = m_itemSize; - qreal requiredWidth = columnWidthsSum() + m_headerWidget->leadingPadding(); + qreal requiredWidth = columnWidthsSum() + m_headerWidget->leadingPadding() + + m_headerWidget->leadingPadding(); // Adding the padding a second time so we have the same padding symmetrically on both sides of the view. + // This improves UX, looks better and increases the chances of users figuring out that the padding area can be used for deselecting and dropping files. const qreal availableWidth = size().width(); if (requiredWidth < availableWidth) { // Stretch the first column to use the whole remaining width