Commit 3169f05f authored by Volker Krause's avatar Volker Krause
Browse files

Determine icon sizes via QStyle, not via KIconThemes

Summary:
Allows us to get rid of the soon to be deprecated usage of the top-level
IconSize() function.

Reviewers: mlaurent

Reviewed By: mlaurent

Subscribers: kde-pim

Tags: #kde_pim

Maniphest Tasks: T11637

Differential Revision: https://phabricator.kde.org/D25898
parent a70df73c
......@@ -60,7 +60,6 @@ find_package(KF5NotifyConfig ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Parts ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5TextEditor ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5IconThemes ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Notifications ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Syndication ${KF5_MIN_VERSION} CONFIG REQUIRED)
......
......@@ -111,7 +111,6 @@ target_link_libraries(akregator_config_plugins
akregatorinterfaces
KF5::KCMUtils
KF5::I18n
KF5::IconThemes
KF5::WebEngineViewer
)
......
......@@ -117,7 +117,6 @@ target_link_libraries(akregatorprivate
KF5::Syndication
akregatorinterfaces
KF5::PimCommon
KF5::IconThemes
KF5::PimTextEdit
KF5::GrantleeTheme
Grantlee5::Templates
......@@ -212,7 +211,6 @@ target_link_libraries(akregatorpart
KF5::PimTextEdit
KF5::GrantleeTheme
KF5::MessageViewer
KF5::IconThemes
KF5::Parts
KF5::Notifications
Qt5::WebEngineWidgets
......
......@@ -27,21 +27,20 @@
#include "kernel.h"
#include "akregator_debug.h"
#include <KIconLoader>
#include <KIconTheme>
#include <KLocalizedString>
#include <KMessageBox>
#include <QUrl>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QStyle>
using namespace Akregator;
AddFeedWidget::AddFeedWidget(QWidget *parent)
: QWidget(parent)
{
setupUi(this);
pixmapLabel1->setPixmap(QIcon::fromTheme(QStringLiteral("applications-internet")).pixmap(IconSize(KIconLoader::Desktop), IconSize(KIconLoader::Desktop)));
pixmapLabel1->setPixmap(QIcon::fromTheme(QStringLiteral("applications-internet")).pixmap(style()->pixelMetric(QStyle::PM_MessageBoxIconSize)));
statusLabel->setText(QString());
}
......
......@@ -27,10 +27,11 @@
#include "subscriptionlistmodel.h"
#include "akregator_debug.h"
#include <KIconTheme>
#include <QApplication>
#include <QHeaderView>
#include <QTreeView>
#include <QStyle>
using namespace Akregator;
......@@ -77,8 +78,7 @@ void Akregator::SubscriptionListDelegate::paint(QPainter *painter, const QStyleO
void Akregator::SubscriptionListDelegate::recalculateRowHeight()
{
KIconTheme *iconTheme = KIconLoader::global()->theme();
m_viewIconHeight = iconTheme ? iconTheme->defaultSize(KIconLoader::Small) : 0;
m_viewIconHeight = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
qCDebug(AKREGATOR_LOG) << "icon height" << m_viewIconHeight;
}
......
......@@ -30,9 +30,9 @@
#include "treenode.h"
#include "akregator_debug.h"
#include <KIconLoader>
#include <KLocalizedString>
#include <QApplication>
#include <QByteArray>
#include <QDataStream>
#include <QIcon>
......@@ -41,6 +41,7 @@
#include <QUrl>
#include <QVariant>
#include <QItemSelection>
#include <QStyle>
using namespace Akregator;
using namespace Syndication;
......@@ -250,7 +251,8 @@ QVariant Akregator::SubscriptionListModel::data(const QModelIndex &index, int ro
return QVariant();
}
const Feed *const feed = qobject_cast<const Feed *const>(node);
return feed && feed->isFetching() ? node->icon().pixmap(KIconLoader::SizeSmall, QIcon::Active) : node->icon();
const auto iconSize = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
return feed && feed->isFetching() ? node->icon().pixmap(iconSize, QIcon::Active) : node->icon();
}
case SubscriptionIdRole:
return node->id();
......
......@@ -41,7 +41,6 @@
#include <KLocalizedString>
#include <KToolInvocation>
#include <kio/global.h>
#include <kio/pixmaploader.h>
#include "actionmanager.h"
#include "akregatorconfig.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment