┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Sitter <[email protected]>2021-04-19 12:39:00 +0200
committerHarald Sitter <[email protected]>2021-04-19 16:07:50 +0000
commit56888a567fc741713b6c905aeed3842a7fa230c7 (patch)
treef6dec4aabc988f9dfc0e88e225572aa505fbc2e9
parent61b2e2fd5e36e486b498a2ae78ce878ce19e6298 (diff)
fix padding in places view
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
-rw-r--r--src/panels/places/placesview.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/panels/places/placesview.cpp b/src/panels/places/placesview.cpp
index 9602fb8ac..5214f47dc 100644
--- a/src/panels/places/placesview.cpp
+++ b/src/panels/places/placesview.cpp
@@ -1,5 +1,6 @@
/*
* SPDX-FileCopyrightText: 2012 Frank Reininghaus <[email protected]>
+ * SPDX-FileCopyrightText: 2021 Harald Sitter <[email protected]>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
@@ -11,6 +12,10 @@
PlacesView::PlacesView(QGraphicsWidget* parent) :
KStandardItemListView(parent)
{
+ KItemListStyleOption option = styleOption();
+ option.padding = 4;
+ setStyleOption(option);
+
const int iconSize = PlacesPanelSettings::iconSize();
if (iconSize >= 0) {
setIconSize(iconSize);
@@ -26,7 +31,6 @@ void PlacesView::setIconSize(int size)
KItemListStyleOption option = styleOption();
option.iconSize = size;
- option.padding = 4;
setStyleOption(option);
}
}