Commit 3bf471e0 authored by Felix Ernst's avatar Felix Ernst 🇺🇦
Browse files

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
parent e50ff16e
Pipeline #161645 passed with stage
in 1 minute and 59 seconds
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment