mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
Extend selection rectangle to left edge
This commit changes it so the sizes of selection rectangles and hover highlights in compact and details view mode is identical for all items. Before this commit, selection rectangles in lists would have varying indentation of the left edge of the selection rectangle depending on the preview image's width-to-height ratio. This would cause a sort of "ragged edge" in both compact and details list view when multiple items were selected. This commit doesn't change anything about icon view mode. BUG: 453046
This commit is contained in:
parent
ca0d0bb322
commit
58622f431b
|
@ -1104,7 +1104,16 @@ void KStandardItemListWidget::updatePixmapCache()
|
|||
|
||||
}
|
||||
|
||||
if (m_layout == IconsLayout) {
|
||||
m_iconRect = QRectF(m_pixmapPos, QSizeF(m_scaledPixmapSize));
|
||||
} else {
|
||||
const qreal widthOffset = widgetIconSize - m_scaledPixmapSize.width();
|
||||
const qreal heightOffset = widgetIconSize - m_scaledPixmapSize.height();
|
||||
const QPointF squareIconPos(m_pixmapPos.x() - 0.5 * widthOffset,
|
||||
m_pixmapPos.y() - 0.5 * heightOffset);
|
||||
const QSizeF squareIconSize(widgetIconSize, widgetIconSize);
|
||||
m_iconRect = QRectF(squareIconPos, squareIconSize);
|
||||
}
|
||||
|
||||
// Prepare the pixmap that is used when the item gets hovered
|
||||
if (isHovered()) {
|
||||
|
|
Loading…
Reference in a new issue