mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
Fix inconsistent preview spacing and icon wiggly-ness when toggling previews in Icon mode
Summary: Dolphin had some code to change the grid spacing when previews were toggled, in an attempt to optimize the view for 3:2 landscape photos. This was problematic for many reasons: - Conceptually, it was a bad idea to optimize the view for one specific use case. Previews are useful for more than just landscape photos, and this optimization would be inapplicable to any other set of files. - Folders entirely full of images commonly have some portrait-orientation images included too, so even if the goal were appropriate, it was a bad idea to optimize for only having landscape images. - For small sizes and medium icons (< 96px), the preview grid size was virtually identical to the non-preview grid size, so it had essentially no effect, and only made the icons wiggle strangely when previews were toggled. - For large large sizes (>= 96px), all it did was unnecessarily increase the horizontal grid spacing, actually //reducing// usability for browsing through folders of images. Therefore, let's just remove this code. BUG: 393306 FIXED-IN: 18.04.1 Test Plan: - Go to {nav Settings > View Modes > Icons} and make the icon size and preview size identical for 64px - Toggle previews on and off - Change both sizes to 112x - Toggle previews on and off In both cases, the grid spacing does not change and the icons do not wiggle strangely. The only visual change is that previews turn on or off. Dolphin still works fine for viewing 3:2 landscape photos. 80px icons: {F5813467} 192px icons: {F5813465} In fact, it's vastly //improved// for the >=96px use case since the grid spacing is no longer excessively wide Reviewers: #dolphin, hein Reviewed By: hein Subscribers: broulik Differential Revision: https://phabricator.kde.org/D12362
This commit is contained in:
parent
ed5102a5fd
commit
e15d9f266b
|
@ -179,14 +179,6 @@ void DolphinItemListView::updateGridSize()
|
|||
const int minItemWidth = 48;
|
||||
itemWidth = minItemWidth + IconsModeSettings::textWidthIndex() * 64;
|
||||
|
||||
if (previewsShown()) {
|
||||
// Optimize the width for previews with a 3:2 aspect ratio instead
|
||||
// of a 1:1 ratio to avoid wasting too much vertical space when
|
||||
// showing photos.
|
||||
const int minWidth = iconSize * 3 / 2;
|
||||
itemWidth = qMax(itemWidth, minWidth);
|
||||
}
|
||||
|
||||
if (itemWidth < iconSize + padding * 2) {
|
||||
itemWidth = iconSize + padding * 2;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue