From kde-core-devel Sat Oct 25 17:31:59 2003 From: Ingo =?iso-8859-15?q?Kl=F6cker?= Date: Sat, 25 Oct 2003 17:31:59 +0000 To: kde-core-devel Subject: [PATCH] Fix loading 22x22 icons with KIconLoader X-MARC-Message: https://marc.info/?l=kde-core-devel&m=106710330632152 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_TOrm/JnhgDmSGwV" --Boundary-00=_TOrm/JnhgDmSGwV Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, the attached patch should fix the problem with the icons in the system tray. For example klipper and ksirc both have a 22x22 icon. But the iconloader loads the small 16x16 icons and then scales them to 22x22 which gives them a blurry look (cf. Eva's message "Am I the only one who thinks this is ugly?"). Regards, Ingo --Boundary-00=_TOrm/JnhgDmSGwV Content-Type: text/x-diff; charset="us-ascii"; name="kiconloader.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="kiconloader.diff" Index: kiconloader.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdelibs/kdecore/kiconloader.cpp,v retrieving revision 1.213 diff -u -3 -p -b -r1.213 kiconloader.cpp =2D-- kiconloader.cpp 18 Sep 2003 03:15:43 -0000 1.213 +++ kiconloader.cpp 25 Oct 2003 16:51:40 -0000 @@ -572,14 +572,16 @@ QPixmap KIconLoader::loadIcon(const QStr if (inCache && (path_store =3D=3D 0L)) return pix; =20 + int desiredSizeOrGroup =3D ( size !=3D 0 ) ? -size : KIcon::User; QString path =3D (absolutePath) ? name : =2D iconPath(name, KIcon::User, canReturnNull); + iconPath(name, desiredSizeOrGroup, canReturnNull); if (path.isEmpty()) { if (canReturnNull) return pix; =2D // We don't know the desired size: use small =2D path =3D iconPath(str_unknown, KIcon::Small, true); + // Use small if we don't know the desired size. + desiredSizeOrGroup =3D ( size !=3D 0 ) ? -size : KIcon::Small; + path =3D iconPath(str_unknown, desiredSizeOrGroup, true); if (path.isEmpty()) { kdDebug(264) << "Warning: Cannot find \"unknown\" icon." << endl; --Boundary-00=_TOrm/JnhgDmSGwV--