m_visibleItems(),
m_visibleGroups(),
m_visibleCells(),
- m_sizeHintResolver(nullptr),
m_layouter(nullptr),
m_animation(nullptr),
m_oldScrollOffset(0),
m_header(nullptr),
m_headerWidget(nullptr),
m_indicatorAnimation(nullptr),
- m_dropIndicator()
+ m_dropIndicator(),
+ m_sizeHintResolver(nullptr)
{
setAcceptHoverEvents(true);
setAcceptTouchEvents(true);
Q_ASSERT(widget->index() == i);
widget->setVisible(true);
+ bool animateIconResizing = animate;
+
if (widget->size() != itemBounds.size()) {
// Resize the widget for the item to the changed size.
if (animate) {
} else {
widget->resize(itemBounds.size());
}
+ } else {
+ animateIconResizing = false;
}
const int newIconSize = widget->styleOption().iconSize;
if (widget->iconSize() != newIconSize) {
- if (animate) {
+ if (animateIconResizing) {
m_animation->start(widget, KItemListViewAnimation::IconResizeAnimation, newIconSize);
} else {
widget->setIconSize(newIconSize);
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