X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/b7a8327c305e3d5bd92bb79889fafc2a75a82adb..e9a39700:/src/panels/places/placesview.cpp diff --git a/src/panels/places/placesview.cpp b/src/panels/places/placesview.cpp index dce5083d7..9602fb8ac 100644 --- a/src/panels/places/placesview.cpp +++ b/src/panels/places/placesview.cpp @@ -1,21 +1,8 @@ -/*************************************************************************** - * Copyright (C) 2012 by Frank Reininghaus * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ +/* + * SPDX-FileCopyrightText: 2012 Frank Reininghaus + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "placesview.h" @@ -26,10 +13,27 @@ PlacesView::PlacesView(QGraphicsWidget* parent) : { const int iconSize = PlacesPanelSettings::iconSize(); if (iconSize >= 0) { + setIconSize(iconSize); + } +} + +void PlacesView::setIconSize(int size) +{ + if (size != iconSize()) { + PlacesPanelSettings* settings = PlacesPanelSettings::self(); + settings->setIconSize(size); + settings->save(); + KItemListStyleOption option = styleOption(); - option.iconSize = iconSize; + option.iconSize = size; + option.padding = 4; setStyleOption(option); } } -#include "placesview.moc" +int PlacesView::iconSize() const +{ + const KItemListStyleOption option = styleOption(); + return option.iconSize; +} +