padding was only applied when the icon size was applied, the icon size
however is only applied when the user had set an explicit size. this
resulted in inconsistent spacing. by default no padding would be used if
the user had changed the icon size to medium and back to small it would
suddenly have padding.
to fix this, set padding unconditionally on construction and never touch
it again .
BUG: 435731
/*
* SPDX-FileCopyrightText: 2012 Frank Reininghaus <frank78ac@googlemail.com>
+ * SPDX-FileCopyrightText: 2021 Harald Sitter <sitter@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
PlacesView::PlacesView(QGraphicsWidget* parent) :
KStandardItemListView(parent)
{
+ KItemListStyleOption option = styleOption();
+ option.padding = 4;
+ setStyleOption(option);
+
const int iconSize = PlacesPanelSettings::iconSize();
if (iconSize >= 0) {
setIconSize(iconSize);
KItemListStyleOption option = styleOption();
option.iconSize = size;
- option.padding = 4;
setStyleOption(option);
}
}