Changeset View
Changeset View
Standalone View
Standalone View
src/views/dolphinitemlistview.cpp
Show First 20 Lines • Show All 173 Lines • ▼ Show 20 Line(s) | 159 | { | |||
---|---|---|---|---|---|
174 | int maxTextLines = 0; | 174 | int maxTextLines = 0; | ||
175 | int maxTextWidth = 0; | 175 | int maxTextWidth = 0; | ||
176 | 176 | | |||
177 | switch (itemLayout()) { | 177 | switch (itemLayout()) { | ||
178 | case KFileItemListView::IconsLayout: { | 178 | case KFileItemListView::IconsLayout: { | ||
179 | const int minItemWidth = 48; | 179 | const int minItemWidth = 48; | ||
180 | itemWidth = minItemWidth + IconsModeSettings::textWidthIndex() * 64; | 180 | itemWidth = minItemWidth + IconsModeSettings::textWidthIndex() * 64; | ||
181 | 181 | | |||
182 | if (previewsShown()) { | | |||
183 | // Optimize the width for previews with a 3:2 aspect ratio instead | | |||
184 | // of a 1:1 ratio to avoid wasting too much vertical space when | | |||
185 | // showing photos. | | |||
186 | const int minWidth = iconSize * 3 / 2; | | |||
187 | itemWidth = qMax(itemWidth, minWidth); | | |||
188 | } | | |||
189 | | ||||
190 | if (itemWidth < iconSize + padding * 2) { | 182 | if (itemWidth < iconSize + padding * 2) { | ||
191 | itemWidth = iconSize + padding * 2; | 183 | itemWidth = iconSize + padding * 2; | ||
192 | } | 184 | } | ||
193 | 185 | | |||
194 | itemHeight = padding * 3 + iconSize + option.fontMetrics.lineSpacing(); | 186 | itemHeight = padding * 3 + iconSize + option.fontMetrics.lineSpacing(); | ||
195 | 187 | | |||
196 | horizontalMargin = 4; | 188 | horizontalMargin = 4; | ||
197 | verticalMargin = 8; | 189 | verticalMargin = 8; | ||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |