D23899: Port from KIconLoader to QIcon::fromTheme
David Faure
noreply at phabricator.kde.org
Thu Sep 12 13:58:53 BST 2019
dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.
INLINE COMMENTS
> kwalletd.cpp:636
> kpd->setWindowTitle(i18n("KDE Wallet Service"));
> - kpd->setPixmap(
> - KIconLoader::global()->loadIcon(QStringLiteral("kwalletmanager"),
> - KIconLoader::Desktop, KIconLoader::SizeHuge));
> + kpd->setPixmap(QIcon::fromTheme(QStringLiteral("kwalletmanager")).pixmap(64));
> if (w != KWindowSystem::activeWindow() && w != 0L) {
The 64 seems a bit too hardcoded, and KPasswordDialog internally defaults to `q->style()->pixelMetric(QStyle::PM_MessageBoxIconSize, &option, q)` (when setPixmap isn't called).
I think the first step is to add a setIcon to KPasswordDialog.
> kwalletwizard.cpp:52
> ui.ktitlewidget->setText("<h1>" + i18n("KWallet") + "</h1>");
> -
> - int iconSize = 3 * fontMetrics().height();
> - // round to multiple of 16
> - iconSize = (iconSize + 8) & ~15;
> - QPixmap pix = KIconLoader::global()->loadIcon(QStringLiteral("kwalletmanager"), KIconLoader::Dialog, iconSize);
> - ui.ktitlewidget->setPixmap(pix);
> + ui.ktitlewidget->setPixmap(QIcon::fromTheme(QStringLiteral("kwalletmanager")));
>
(we should add a setIcon overload to KTitleWidget, this setPixmap method is misnamed).
REPOSITORY
R311 KWallet
REVISION DETAIL
https://phabricator.kde.org/D23899
To: vkrause, davidedmundson, dfaure
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190912/6a80bf29/attachment-0001.html>
More information about the Kde-frameworks-devel
mailing list